#Grsync exclude directory full
The man page offers full details, but I found a lot of good info on rsync examples by Googling around the web. Rsync is very powerful, but also very complex, and I am far from an expert on using it. tar -X /.grsync/exclude.txt -cvpzf /run/media/dave/Backups/ The exclude file I’m specifying with the -X option is the same one I use with grsync (and I guess I’d better check that it’s working there). But for me, it means that my backup is always perfectly synchronized with the source, which is what I want. Not everyone wants to do this, so you should consider the consequences of that option. The -delete option means that if I delete a file in the source between backups, then it will be deleted in the destination also on my next backup. I simply copy the commands from a text file (a BASH script would work nicely too) and paste into a terminal after making sure that I have the correct flash drive inserted (the destination: /media/stan/DBB0-4F8C/). Rsync -delete -avhs "/home/stan/Documents/ALL_eStatements" "/media/stan/DBB0-4F8C/"
Rsync -delete -avhs "/home/stan/Documents/HomeBank" "/media/stan/DBB0-4F8C/" & Rsync -delete -avhs "/home/stan/Documents/MyKeePass" "/media/stan/DBB0-4F8C/" & so it would likely be slower on an external hard drive, or even worse over a network connection.įor my own personal rsync backup solution, I join several rsync commands together (concatenate) with & similar to this: I did this backup on the same hard drive and it took about 7-8 minutes. I ran it again with sudo and then it copied every file, but that makes root the owner of the backed up directory. Also, the command as given above neglected to copy 8 files (yes, only 8 out of over 330,000) due to permission problems. it was over 330,000 files and about 6 GB. I ran a test of the above command on my own /usr directory. I'm not quite sure that /usr is a useful backup for you, but that is your decision. If you put the trailing / it will only copy the loose files inside (and create quite a mess in your destination). That will copy the directory itself and all the contents. srv/http/projects/project/ the added option -m.Especially note that there is no trailing / on the source. This can be fixed with the rysnc option -m, but then all empty dirs will be skipped.ġ) Create an include filter file, for instance "include_filter.txt": + /**/Ģ) Run it: rsync -avzm -delete -include-from=include_filter.txt \
#Grsync exclude directory plus
Alternatively the directory contents can be excluded by the directory itself remains. rsync -a -exclude 'mydir' /home/ismail /mnt/disk. In the following example we will exclude the directory named mydir like below. You have no choice but to manually descend for each level of your sub-directory. The exclude option is used to specify the directory name.