LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   RSYCN Help (https://www.linuxquestions.org/questions/linux-general-1/rsycn-help-604124/)

carlosinfl 12-03-2007 08:07 AM

RSYCN Help
 
I am trying to sync two servers on my LAN as a backup and was wondering if I am running the correct command. The production server is "server-1" and the backup server I am copying everything to is "server-2".

I basically just want any changes made on server-1 to be copied to server-2 including if a file is removed / changed from server-1, it should mirror to server-2.

Is this command correct to be ran from "server-1"?

Code:

rsync -ave ssh --stats --delete-after /share/ctia/share/ root@10.1.1.29:/ctia/LT2FS1

forrestt 12-03-2007 11:18 AM

It should probably be run as root, so you won't need the root@.
Code:

/usr/bin/rsync -ave ssh --stats --delete-after /path/to/directory server-2:/path/to
Don't know where you want it to end up on server-2, but if the command is putting things in the right place, then your command is fine. If it isn't try to use what I've written to help you figure it out.

HTH

Forrest

carlosinfl 12-04-2007 01:14 PM

Yes,

my command is placing the items in the right place so all looks well. I made a new file in server-1 and ran RSYCN and it shows up on server-2. I then remove it from server-1 and next time I run the command, it is no longer on server-2. Exactly what I want.

Now my only question is if there is a difference in the command --delete-after and --delete?


All times are GMT -5. The time now is 09:30 PM.