snapshots directory not set for slave
-The slave PFS is not mounted but a symlink can be created in the root Hammer file system to point to it. This step is optional, the PFS can be read through its original magic symlink in /Backup2/pfs.
+The slave PFS is not mounted but a symlink can be created in the root Hammer file system to point to it.
# ln -s /Backup2/pfs/test /Backup2/test
# ls -l /Backup2/test
lrwxr-xr-x 1 root wheel 17 Oct 8 12:07 /Backup2/test -> /Backup2/pfs/test
+(This step is optional, the PFS can be read through the original magic symlink /Backup2/pfs/test.)
+
#Copying contents from PFS on Disk 1 to PFS on Disk 2 to enable mirroring.
The slave PFS will be accessible only after the first 'mirror-copy' operation.
#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.
-
- # 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.
+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.
- (cd /root/adm; /usr/bin/lockf -k -t 0 .lockfile ./hms) &
+ @reboot hammer mirror-stream /Backup1/test /Backup2/test
-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)