rsync question
Hey guys, I have rsync going to another remote server
it works good, however, lets say server A deleted a directory, server B wont sync up to it. if I were to add a directory to Server A, then server B will add it as well. so server B is just not deleting stuff. is there a proper rsync command i can use ? would rsync -xzva --delete /src /dst delete everything and start the rsync from scratch? or is there another way to do this |
Quote:
You probably wanted Code:
rsync -xzva --delete /src/ /dst If there are any hard linked or sparse files under /src, you should take a look at the "-H" and "-S" options. |
Thank you for the reply!
I understand /src vs /src/ actually took me a while why rsync was doing that ha ha! anyhow, so --delete would delete the stuff that did not exist from /src, but not the entire content, correct? reason I ask is because I rsync 100 gigs and it would take way too long for it to back up |
It will delete only the files that do not exist in the source. There are several variants of "--delete", such as "--delete before", "--delete during", and "--delete after". You really should read the rsync manpage and understand when some of those might be more appropriate.
You can always run rsync with the "-n" and "-v" options to safely see exactly what it is going to do and when. |
ya that is what i thought...however it is not working for me.
this is what I am using #!/bin/bash rsync -zavh --delete /files root@server.com:/backup/daily my cron job is set to * * * * script.sh so i can test it every min when I run the su -s * command, i see it is always deleting everything inside and starting the rsync over. so that is the part I am trying to figure out. i even let the rsync finish then ran rsync -zavh --delete /files root@server.com:/backup/daily again and deleted everything all over and starts the rsync from start |
Quote:
What are your source and destination filesystems? |
Perhaps some issue with the "root@" where the remote rsync user is different from the local user. I don't know. I've never used rsync that way. You could try including the "-i" (--itemize-changes) option and get some idea from what rsync believed had to be changed.
|
Quote:
Code:
rsync -zavh /files root@server.com:/backup/daily --delete |
All times are GMT -5. The time now is 05:47 AM. |