Linux rsync exclude examples

有時候會有不想複製的檔案類型要同步,例如不想複製 *.zip 就用下列指令:

[root@liho ~]# rsync -avl --progress --exclude '*.zip' /home/foo/xxx /scratch/foo/bar

如果有要列舉哪些目錄不想複製,就可以用下列指令排除:

[root@liho ~]# rsync -avl --progress --exclude={'xxxx','yyy','zzz','*.log'} /home/foo/xxx /scratch/foo/bar

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.