-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I have been using rsync to backup our primary data stores. It works fine. Here are the options I use for doing that: rsync --recursive --links --times --dirs --stats --delete \ --itemize-changes --quiet --exclude-from=exclude-filename \ /data-store1/ /data-store2/ Recently I have had the need to actually synchronize the files between two data stores. That is, whichever data store has the newest timestamp updates the other data store. What are some recommended ways for using rsync to synchronize two data stores? - -- James Moe moe dot james at sohnen-moe dot com 520.743.3936 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk98q6EACgkQzTcr8Prq0ZNH7wCfSViELxA6i+2VvmTeRrUrTZsF 5iUAnjYxsQOdRoQ1k8YQP/fhhkcWbymV =Bf6Z -----END PGP SIGNATURE-----
In <4F7CABA1.3020103 at sohnen-moe.com>, on 04/04/12 at 01:14 PM, James Moe <jimoe at sohnen-moe.com> said: Hi James,>rsync --recursive --links --times --dirs --stats --delete \ > --itemize-changes --quiet --exclude-from=exclude-filename \ > /data-store1/ /data-store2/FWIW, --dirs is rundundant in the above.> Recently I have had the need to actually synchronize the files between >two data stores. That is, whichever data store has the newest timestamp >updates the other data store.Take a look at --existing and --update. Some combination of of these will probably get you the result you want. It depends on your definition of synchronize. Regards, Steven -- ---------------------------------------------------------------------- "Steven Levine" <steve53 at earthlink.net> eCS/Warp/DIY etc. www.scoug.com www.ecomstation.com ----------------------------------------------------------------------
In <4F7CF7E1.5070902 at sohnen-moe.com>, on 04/04/12 at 06:39 PM, James Moe <jimoe at sohnen-moe.com> said: Hi James, Please reply to the list so that others may participate.> Neither, or both, of those options seem to meet my requirement. > --existing, "skip creating new files on receiver", appears to be >counterproductive for synchronizing.As I said, it depends on how you define synchronize. There are times when I need to bring the existing files into sync while not adding any new files. This is where --existing is useful. The result is the files are synchronized, although the resulting file sets might not be identical.> But I still see no way to update the sender's files if the receiver's >files are newer. Would I have to run another rsync session with the >sender and receiver reversed?Yes. I neglected to mention it because I considered it obvious. Sorry about that. Rsync is basically a very smart copy command. Rsync can be made act like a move command with the --remove-source-files, but this a special case. BTW, don't forget to drop the --delete from the command lines. Regards, Steven -- ---------------------------------------------------------------------- "Steven Levine" <steve53 at earthlink.net> eCS/Warp/DIY etc. www.scoug.com www.ecomstation.com ----------------------------------------------------------------------