I am trying to keep two peer directories in sync using rsync. The problem I have is that new files can be added or deleted in either directory before a sync occurs.
If a deletion occurs in one, then the --delete option would delete that file in the other location as long as it was chosen as the target first. Otherwise, if the directory with the stale file still in it was chosen as the source initially, then the file would be copied across to the directory we had previously deleted it from.
If a file is created in one and that directory is not chosen as the source, then the file will be classed as extraneous by the --delete option and be removed, despite being a valid addition.
Is there a way of making more intelligent deletions or excludes based on timestamps? If not, then I only see rsync as a master-slave tool, and not able to cope with a peer-peer relationship.