rsync排除某些目录
How to exclude directories with certain names like “cache” from rsync on Linux during backup?
如何在备份过程中从Linux上的 rsync中排除具有某些名称(例如“ cache ”)的目录?
The “cache” directory may in many different paths, such as file1/cache/ or file2/cache/, and adding all “cache” directories to rsync command is not a doable way.
“缓存”目录可能位于许多不同的路径中,例如file1 / cache /或file2 / cache /,并且将所有“缓存”目录添加到rsync命令不是可行的方法。
You can use rsync
with --exclude=cache/
like
您可以将rsync
与--exclude=cache/
一起使用
rsync -avxP --exclude=cache/ /path/to/src/directory/ /path/to/dst/dir/
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。
翻译自: https://www.systutorials.com/how-to-exclude-directories-with-certain-names-from-rsync-on-linux/
rsync排除某些目录