|
|||
|
Seems like it might be as easy as creating a script that looks like this:
rsync -e ssh -avz root@primaryserver:/etc/localdomains /tmp/secondarymx cat /etc/secondarymx >>/tmp/secondarymx cat /tmp/secondarymx |sort |uniq >/tmp/secondarymx.new mv /tmp/secondarymx.new /etc/secondarymx rm /tmp/secondarymx Then, put that script in cron and it should do what you want. Mine is probably not the only way to go, and there may be ways to optimize, but that's what I can pull out of my head at the moment. |
|
||||
|
Thank you I will try that out tonight, the logic looks very sound, and I'm sure that would work so I'll report back my results.
Just a thought, doesn't rsync have an append function, would that work I wonder? I'll have to test that as well. Thanks Aaron |
|
|||
|
rsync does have an append fucntion, but it doesn't do what you think. Here is the man page excerpt:
--append This causes rsync to update a file by appending data onto the end of the file, which presumes that the data that already exists on the receiving side is identical with the start of the file on the sending side. If that is not true, the file will fail the checksum test, and the resend will do a normal --inplace update to correct the mismatched data. Only files on the receiving side that are shorter than the corresponding file on the sending side (as well as new files) are sent. Implies --inplace, but does not conflict with --sparse (though the --sparse option will be auto-disabled if a resend of the already-existing data is required). So, essentially, it is just another, more bandwidth efficient method to transfer the whole file. Note: my rough script above would not remove a domain that was deleted from secondarymx on primaryhost. Otherwise, I think it'll work too. Last edited by jerrybell; 08-09-2007 at 08:51 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|