Exclude multiple files or folder in rsync command

 1.  rsync command for multi exclude files or folder

$ rsync -arv --exclude={'course','download','tmpfile.txt'} /var/www/  /backup/www

one folder

$ rsync -arv --exclude 'download' /var/www/ /backup/www

one file

$ rsync -arv --exclude 'tmpfile.txt' /var/www/ /backup/www

wildcard or patterns
$ rsync -arv --exclude '*.iso' /var/www/ /backup/www

-a: -rlptgoD

-v: verbose

-r: --recursive

references

https://linuxhint.com/exclude-directory-rsync/

https://phoenixnap.com/kb/rsync-exclude-files-and-directories

 

 

 

 

這個網誌中的熱門文章

取消Excel與word網際網路與網路路徑超連結自動格式

Installing VMware workstation pro on Ubuntu 22.X (Jammy Jellyfish)