排除对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.txt
5.txt
6.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.txt
5.txt
6.txt
a.txt
b.txt


法3:

[root@web01 tmp]# cat /exclude.txt 
1.txt
2.txt
3.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.txt
5.txt
6.txt
a.txt
b.txt