【发布时间】:2019-04-15 04:29:24
【问题描述】:
我有两个带有文件夹列表的文件。我想将具有相对路径的文件夹同步到目标,不包括排除文件中的文件夹。
$ cat include.txt
/home/user
/etc
/data/app
/boot
$ cat exclude.txt
/data/app/temp
/etc/aide
我尝试过使用--include-from 和--files-from,但似乎无法弄清楚。
这似乎是同步文件夹,而不是文件:
rsync -av --files-from=include.txt / /destination
最终我想同步到/destination 并让文件夹结构看起来像:
/destination/home/user
/destination/home/user/...
/destination/etc
/destination/etc/...
/destination/data/app
/destination/data/app/...
/destination/boot
/destination/boot/...
【问题讨论】: