rsync home dirs but exclude sub paths
Posted: 2019/01/22 17:26:27
Hello everyone,
I'm using several CentOS 7 systems to backup home directories. Essentially, I use the following command:
It works fine and the --delete parameter ensures the remote hasn't got any stale files left over from previous rsyncs. Unfortunately, that is also the problem, I want to exclude some specific directories from being part of the --delete parameter.
For example
/home/user/files/
/home/user/files/images (always keep remote files)
/home/user/data/
...etc..
How would I exclude /home/*/files/images/ from the --delete parameter?
I'd appreciate some help.
Thank you.
I'm using several CentOS 7 systems to backup home directories. Essentially, I use the following command:
Code: Select all
/usr/bin/rsync -tarlzvh -P --delete --exclude='tmp/*' /home/ 192.168.1.1::home
For example
/home/user/files/
/home/user/files/images (always keep remote files)
/home/user/data/
...etc..
How would I exclude /home/*/files/images/ from the --delete parameter?
I'd appreciate some help.
Thank you.