排除对1.txt,2.txt,3.txt的同步
法1:
[root@web01 tmp]# rsync -avz --exclude={1.txt,2.txt,3.txt} . rsync_backup@192.168.2.23::backup --password-file=/etc/rsync.password sending incremental file list./4.txt5.txt6.txt
法2:
[root@web01 tmp]# rsync -avz --exclude={1..3}.txt . rsync_backup@192.168.2.23::backup --password-file=/etc/rsync.password sending incremental file list./4.txt5.txt6.txta.txtb.txt
法3:
[root@web01 tmp]# cat /exclude.txt 1.txt2.txt3.txt[root@web01 tmp]# rsync -avz --exclude-from=/exclude.txt . rsync_backup@192.168.2.23::backup --password-file=/etc/rsync.password sending incremental file list./4.txt5.txt6.txta.txtb.txt