Can rsync monitor a file system?
cbiedl at gmx.de
Tue Jun 27 10:33:10 GMT 2006
Tim H wrote...
> what about scripts running every 30 seconds on each machine,
> thats lighter then rsync just to compare..
> ---- Server1 ----
> ls -lR /* > ~/files1
> scp files1 SERVER2:~
> ---- Server2 ----
> ls -lR /* > ~/files2
> (do a diff command here on files1 vs. files2)
> (if different, then run rsync -u)
Well, the things rsync does aren't much different from that. But
doing this every 30 seconds is a good way to get a lot of I/O load.
If Charles' intention is to get really fast replication he'd better
review his storage strategy. For example, using mysqld and a "slave"
daemon does this without overhead.
If there's no alternative to a file based storage, I strongly suggest to
do a triggered rsync, not polling. Linux has notifications if there was
a change in the file system (inotify, fam [file alteration monitor]).
I'm sure there are similar things for Solaris.
More information about the rsync