Answer the question
In order to leave comments, you need to log in
Rsync how to set --exclude correctly?
Hello Lord!
I understand that the question is completely lamer, but so far I'm trying to no avail.
There is a need for backup and I decided to use rsync as a tool. Everything is great! I really like it, but ... I can’t specify the directory that I don’t need to synchronize / copy.
Actually, what we have: the documents for backup are on a Windows server, the backup machine is on Debian x64.
I did not fence the garden and mount the network drive in / mnt / net /. Backups should be placed in /mnt/sdb/. And then the problem crept out: there is an @Recycle directory on the Windows disk and I need to exclude it from copying. And it fails to do so.
rsync -avzhe --exclude '/mnt/net/@Recycle/' --progress /mnt/net/ /mnt/sdb1/
And rsync is starting to port @Recycle with great pleasure.
Where did I get it?
Answer the question
In order to leave comments, you need to log in
Here is an example for archiving the entire system with exceptions
tar cvpjf /mnt/backup/all.tar.bz2 / --exclude /proc --exclude /sys --exclude /tmp --exclude /var/tmp --exclude /usr /tmp --exclude /mnt
Escaping "\"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question