2 server on FreeBSD (#1 and #2) running rsync'ω, which are in different apartments. Each server has one 500GB hard storing work and personal information.Task:
To do smart sync, which I knew how:1.
When you add/remove/change information on server #1, it should be added/deleted/changed on the server #2.2.
Similarly to item 1 in reverse order.That's what I did:
On server #2 added in cron the following command:
/usr/local/bin/rsync -avz-e 'ssh -p 22' --partial /hdd/docs/ email@example.com:/hdd/docs/ # from server #1 to server #2
/usr/local/bin/rsync -avz-e 'ssh -p 22' --partial firstname.lastname@example.org:/hdd/docs/ /hdd/docs/ # and Vice versa
The problem arose when I started to add the keys
delete-after Delete files on the slave (#2), which was not found on the master (#1), after synchronization.
You can also use delete-before, delete-during, delete-excluded, and delete.
It turned out that just deleted/changed the first command in the crown file #1 is re-created when you sync #2 to #1 the second team and Vice versa.
Is there a solution?