I am trying to setup bi-direction or two way sync with rsync. In my case I only need to delete the files when syncing from B to A. So, I was thinking of running rsync twice as follow :
rsync -rtuv ./A/ ./B/ rsync -rtuv --delete ./B/ ./A/
This problem with this solution is that when I run rsync (B->A) which would be right after running the rsync (A-B), Any new file that get created in between the sync will also get removed.
Is there a way I can specify a time stamp as condition that it only delete the file if it created before this date/time.
I understand there is a unison solution but the problem with unison is required to install on both ends. I am syncing with a remote server and I can not install unison on the remote end.