我正在使用rsync(1)来更新本地 debian 存储库。最近,我用来存储它的磁盘开始空间不足,所以我决定使用符号链接来允许我将一些目录移动到另一个类似大小的磁盘。
不幸的是,rsync 似乎正在删除符号链接并重新填充几乎已满的磁盘。经过一番搜索,我发现了--keep-dirlinksrsync 选项,它似乎是为解决我的问题而量身定制的。
只是没有。目标上的符号链接仍在被删除。
这是我的 rsync 命令:
rsync --recursive --keep-dirlinks --links --hard-links --times --verbose \
--delete --delete-excluded $EXCLUDE $SOURCE_EXCLUDE \
$RSYNC_HOST::$RSYNC_DIR/pool/ $TO/pool/
Run Code Online (Sandbox Code Playgroud)
EXCLUDE 扩展以消除大量我不感兴趣的架构,沿着--exclude binary-alpha/ --exclude disks-alpha .... 在 rsync 启动之前,我的池目录如下所示:
lrwxrwxrwx 1 root root 23 2014-09-22 13:58 contrib -> /u2/debian/pool/contrib
drwxrwxr-x 62 root root 4096 2012-04-09 03:02 main
lrwxrwxrwx 1 root root 24 2014-09-22 13:58 non-free -> /u2/debian/pool/non-free
Run Code Online (Sandbox Code Playgroud)
rsync 启动后,我得到以下信息:
receiving incremental file list
deleting non-free
deleting contrib
./
contrib/ …Run Code Online (Sandbox Code Playgroud)