I would like a simple tool for syncing two folders on remote servers...
Utopically, I only need an OS catchable trigger (or something like that) that could be used to fire rsync automatically ?
Is there anything of the sort, or a simple tool capable of doing this ?
rsync each minute is not at all an elegant solution to the problem ... i would like to call rsync each time a file is written/deleted in any one of the servers, in a specific folder...
the goal is to easily maintain to remote folders in sync
update: maybe something like gamin... ?
thanks !
arod
In my answer to this question, I suggested incron. It's easy to set up system-wide and user-specific config files in a manner similar to
cron
. You can specify scripts that will be run when filesystem events are triggered. It uses the Linux kernel inotify API. You might take a look at it and see if it works for you.Try inotify. For your relative simple requirements this should be best suited.
An example script:
Or something like that.
With inotify you have access to those events:
It seems like DRBD will do just what you need. It works at the block device level, so if you don't want to maintain a separate partition for this synchronized data, you can just create a disk image and mount it loopback, using DRBD to keep things in sync with the remote server.
The obvious solution here is afs
There all sorts of complications using DRBD on anything but a small LAN with high levels of connectivity between nodes.
But you could roll your own solution using inotify