Does rsync ignore file timestamps and automatically overwrite on client if file is different on server?

I'm trying to set up two PCs to sync a folder tree so that each PC will have a copy of the tree with the most recent updates to each file.

I considered setting up Mercurial but realized I don't really care about versioning (especially since I'm low on disk space), and that rsync sounds like it does more of what I want - just keeping files up to date, no versions.

However, the page at http://www.linuxjournal.com/content/synchronizing-your-life says the following:

With rsync, any files that already существовать в пункте назначения не будет переведен. Это ускоряет время передачи значительно. Тем не мение, по-прежнему существует проблема наличия доработки сделаны с обеих сторон. По по умолчанию программа rsync смотрит только чтобы увидеть, отличаются ли файлы в размер и отметка времени. Это не волнует какой файл новее, если это другой, он перезаписывается.

Вы можете передать флаг --update в rsync что заставит его пропускать файлы на пункт назначения, если они новее, чем файл в источнике, но только так пока они одного типа файл. Это означает, что если для Например, исходный файл является обычным файл и место назначения - символическая ссылка, файл назначения будет перезаписывается независимо от отметки времени. Даже если не смотреть на его причуды, Флаг --update не решает проблему, потому что он просто пропускает файлы в месте назначения, если они новее, эти изменения не тянутся down to the source computer.

Is this correct?

If so, I guess it makes rsync really only useful for backing up one master ("source") machine onto one or more slaves that will get the changes from the master regardless of timestamps. Whereas the problem I'm really trying to solve is having two machines be "peers" and equally just get the most recently updated files from the other.

Or do you think I'll just have to bite the bullet and use git or Mercurial despite the extra disk space for tracking versions?

(Yes I know about Dropbox; I'm well above the 2GB free account limit and not really interested in spending $120-$240 a year when I don't need the cloud storage and something this simple has to have been done before with free & open tools.)

The PCs are both running XP but I was going to use Cygwin's rsync and any other Unixy tools necessary to get the job done.

8
задан Chirael 4 September 2010 в 06:40
поделиться