From: sgeorge Date: Thu, 8 Oct 2009 07:43:15 +0000 (-0700) Subject: (no commit message) X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/commitdiff_plain/35c80e1607eb7b59e375a5598c50826e86f23399 --- diff --git a/docs/how_to_implement_hammer_pseudo_file_system__40___pfs___41___slave_mirroring_from_pfs_master/index.mdwn b/docs/how_to_implement_hammer_pseudo_file_system__40___pfs___41___slave_mirroring_from_pfs_master/index.mdwn index 308a0395..63381b0a 100644 --- a/docs/how_to_implement_hammer_pseudo_file_system__40___pfs___41___slave_mirroring_from_pfs_master/index.mdwn +++ b/docs/how_to_implement_hammer_pseudo_file_system__40___pfs___41___slave_mirroring_from_pfs_master/index.mdwn @@ -87,3 +87,36 @@ We do the "sync" so that the file creation operation in flushed from the kernel # ls /Backup2/test/ test-file + +#Enabling continuous mirroring. + +You can enable continuous mirroring by editing a few files. +One way to make sure the mirroring works continously is to use the 'lockf' utility. +This is one way to do it. + + # mkdir /root/adm && cd /root/adm + # touch .lockfile + +Now make two scripts 'hms' and 'hmc' with the following contents inside /root/adm + + # cat hms + hammer mirror-stream /Backup1/test /Backup2/test & + + # cat hmc + hammer synctid /Backup1/test + hammer mirror-copy /Backup1/test /Backup2/test + +Edit '/etc/rc.local and add the following line. + + (cd /root/adm; /usr/bin/lockf -k -t 0 .lockfile ./hms) & + +Edit 'crontab' and add the following Lines. + + #Check and restart mirroring if needed every 10 minutes + 10 1 * * * (cd /root/adm; /usr/bin/lockf -k -t 0 .lockfile ./hms) & + +Edit '/etc/rc.shutdown.local' and add the following lines. + + pkill -f /usr/bin/lockf -k -t 0 .lockfile ./hms + pkill -f hammer mirror-stream /Backup1/test /Backup2/test + (cd /root/adm; /usr/bin/lockf -k -t 10 .lockfile ./hmc)