#Enabling continuous mirroring.
-You can enable continuous mirroring by editing a few files.
-One way to make sure the mirroring works continuously is to use the 'lockf' utility.
-This is one way to do it.
+The hammer mirror-stream will automatically restart if the connection is lost so you only need to start it up once at boot.You can do this with an @reboot entry in the crontab.
- # mkdir /root/adm && cd /root/adm
- # touch .lockfile
+ @reboot hammer mirror-stream /Backup1/test /Backup2/test
-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)