If I run "rsync -ruv <local> <remote>" twice, no files are copied the second time - as expected. However, if I follow "rsync -ruv <local> <remote>" with "rsync -ruv <remote> <local>", all files are copied from <remote> to <local>. I suspect this is because the timestamps of <remote> files are of when they were copied from <local> to <remote>, hence more recent than the last time they were edited on <local>, and consequently they are copied back to <local>. I alternately edit files on both <local> and <remote>, so I must use rsync in both directions. Is there any way to prevent files copied to <remote> from being copied back to <local>, unless they've been modified in the meantime? Can rsync preserve the timestamp of an original when it is copied? Or perhaps update the timestamp of the original so it matches the copy? For that matter, I run rsync in both directions every time I use it - to propagate changes in both directions. Can rsync instead be invoked once to perform a reciprocal update? To synchronize <local> and <remote> by copying updated files in both directions? Thanks, Jack
On Fri, Jan 30, 2004 at 12:32:47AM -0800, ms419@freezone.co.uk wrote:> Can rsync preserve the timestamp of an original when it is copied?You can find the answer to this in the man page as well as in the help output, just look for the word "time". (Hint: -t)> For that matter, I run rsync in both directions every time I use it - > to propagate changes in both directions.You really want to be using "unison", since this is what it is designed to do. It handles deletions (which your invocation of rsync doesn't), lets you see a diff of what changed, handles conflicts caused by a change on both sides, etc., etc. ..wayne..