+}
+
+# Obtain the zpool guid for the local pool
+local_pool_guid=`zpool get guid $local_pool 2>&1 | grep $local_pool | awk '{ print $3 }'`
+zpool get guid $local_pool > /dev/null 2>&1
+if [ $? != 0 ]; then
+ echo >&2 "-E- Unable to extract the guid for the local pool: $local_pool"
+ exit 1
+fi
+
+# Setup our backup marker names
+current_backup_marker=@current-backup-${local_pool_guid}
+previous_backup_marker=@previous-backup-${local_pool_guid}
+
+# Auto snapshot every zfs filesystem on the system specified below
+echo "$date ZFS replicate started" >> $logfile
+echo "$date ZFS replicate started" | tee -a $mylogfile
+
+# Sort the filesystems to replicate by the oldest backup first
+tmpfile=`tempfile`
+for filesystem in $filesystems_to_replicate; do
+ age=`snapshot_age $filesystem`
+ echo $filesystem $age >> $tmpfile
+done
+sorted_filesystems=`cat $tmpfile | sort -n -k 2 | awk '{ print $1 }'`
+rm -f $tmpfile
+
+# Replicate the sorted filesystems
+for filesystem in $sorted_filesystems; do
+ echo "-> Replicating $remote:$filesystem to ${local_pool}/${filesystem}" | tee -a $mylogfile
+ replicate $remote $filesystem