+# Make sure we have valid arguments
+if [[ -z "$remote" ]] || [[ -z "$remote_fs" ]]; then
+ echo "Usage: $0 <hostname> <zfs filesystem>"
+ exit 1
+fi
+
+# Make sure the local pool and local receiving filesystem exist, or print some errors
+if ! zpool list -H "$local_pool" >/dev/null 2>&1; then
+ echo >&2 "-E- The local pool, '$local_pool' doesn't seem to exist."
+ exit 1
+fi
+if ! zfs list "$local_pool/$remote_pool" >/dev/null 2>&1; then
+ echo >&2 "-E- The local filesystem for the remote pool, '$local_pool/$remote_pool' doesn't seem to exist."
+ echo >&2 " You will need to create this filesystem before this script can replicate your data."
+ echo >&2 " You can create this filsystem by executing this command: 'zfs create $local_pool/$remote_pool'"
+ exit 1
+fi
+
+# Obtain the zpool guid for the local pool
+local_pool_guid=`zpool get guid $local_pool 2>&1 | grep $local_pool | awk '{ print $3 }'`
+if ! zpool get guid $local_pool > /dev/null 2>&1; then
+ echo >&2 "-E- Unable to extract the guid for the local pool: $local_pool"
+ exit 1
+fi
+
+# Turn on shell verbosity
+set -x
+
+# Setup our backup marker names
+current_backup_marker=${remote_fs}@current-backup-${local_pool_guid}
+previous_backup_marker=${remote_fs}@previous-backup-${local_pool_guid}
+