如何处理过多级别的符号链接?

Ant*_*ony 6 windows symbolic-link

我正在使用 Ubuntu Live USB 来访问我的 Windows 文件,我想对 WindowsC:驱动器执行一个完整的、逐个文件的备份。

由于我想要备份所有内容,因此我正在复制和粘贴。复制C:驱动器,将其粘贴到外部驱动器。

不幸的是,我遇到了一个问题:我收到一条错误消息,指出Too many levels of symbolic links.

这是什么意思,我该如何解决?

don*_*oey 2

我建议您使用rsync而不是cp按照您想要的方式备份数据。Rsync有几个选项来处理符号链接。符号(符号)链接只是到另一个文件的链接。它有点像windows语言中的“快捷方式”。

    -l, --links                 copy symlinks as symlinks
    -L, --copy-links            transform symlink into referent file/dir
        --copy-unsafe-links     only "unsafe" symlinks are transformed
        --safe-links            ignore symlinks that point outside the tree
    -k, --copy-dirlinks         transform symlink to dir into referent dir
    -K, --keep-dirlinks         treat symlinked dir on receiver as dir
    -H, --hard-links            preserve hard links
Run Code Online (Sandbox Code Playgroud)

这是一个简单的例子:

sudo rsync --verbose --recursive --links --perms --executability --owner --group --times /media/some-user-name/the-c-drive-you-want /media/some-user-name/the-external-drive
Run Code Online (Sandbox Code Playgroud)

使用该选项--dry-run进行假设运行,不会向外部驱动器写入任何内容。

阅读man rsync来了解有关不同选项的更多信息。