1. Exclude one directory
2. Exclude multiple directories using pattern
3. Exclude one file
4. Exclude certain file types
5. Exclude multiple files and folders at the same time
or,
where: exclude-list.txt contains excluded files and folder names
e.g.
excluded-file.txt
excluded/directory/
var/log/
media/catalog/product/cache/
$ rsync -avz --exclude 'dir1' source/ destination/
2. Exclude multiple directories using pattern
$ rsync -avz --exclude 'dir*' source/ destination/
3. Exclude one file
$ rsync -avz --exclude 'dir1/dir2/file3.txt' source/ destination/
4. Exclude certain file types
$ rsync -avz --exclude '*.txt' source/ destination/
5. Exclude multiple files and folders at the same time
$ rsync -avz --exclude file1.txt --exclude dir3/file4.txt source/ destination/
or,
$ rsync -avz --exclude-from 'exclude-list.txt' source/ destination/
where: exclude-list.txt contains excluded files and folder names
e.g.
excluded-file.txt
excluded/directory/
var/log/
media/catalog/product/cache/
No comments:
Post a Comment