使用rsync -aP --exclude=upload 只能排除upload文件/目录。
如果要排除多个文件/目录,怎么办?
  那只能建一个exclude.list,里面填写要排除的目录(一行一个文件/目录),然后rsync -aP --exclude-from=“exclude.list“

如:rsync -aP  --exclude-from=/root/exclude.list 192.168.113.118::web_bak/www/ /data/server/www/    (从118同步数据到本机)

补充
     --exclude=PATTERN       exclude files matching PATTERN
     --exclude-from=FILE     read exclude patterns from FILE
     --include=PATTERN       don't exclude files matching PATTERN
     --include-from=FILE     read include patterns from FILE

 

 

 

rsync -rvz --delete -e 'ssh -p 22' --progress --remove-sent-files --exclude=/tmp/test/ccc/3  /tmp/test/ root@172.16.160.99:/tmp/

相关文章:

  • 2022-12-23
  • 2021-11-22
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
猜你喜欢
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案