From 5c9c5987a01b3c469f62e6842044940e2887f7b2 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 20:58:03 +0100 Subject: [PATCH 1/8] simplesnapwrap: Use 'ghead' if available ... as the system 'head' may not understand negative line counts. Fixes "simplesnapwrap reap mainset dpool" on ElectroBSD. --- simplesnapwrap | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/simplesnapwrap b/simplesnapwrap index f3c22d9..f8ba6f5 100755 --- a/simplesnapwrap +++ b/simplesnapwrap @@ -48,6 +48,8 @@ SED="gsed" gsed &> /dev/null || SED="sed" GREP="ggrep" ggrep &> /dev/null || GREP="grep" +HEAD="ghead" +ghead &> /dev/null < /dev/null || HEAD="head" # template - $1 @@ -98,10 +100,10 @@ if [ "$1" = "reinvoked" ]; then logit "Listing snapshots on \"${DATASET}\" with template \"${TEMPLATE}\"" USINGBOOKMARK=0 - OLDESTSNAP="`listsnaps \"${TEMPLATE}\" \"${DATASET}\" | head -n 1`" + OLDESTSNAP="`listsnaps \"${TEMPLATE}\" \"${DATASET}\" | $HEAD -n 1`" if [ -z "${OLDESTSNAP}" ]; then logit "Found no existing snapshot, looking for a bookmark." - OLDESTSNAP="`listbookmarks \"${TEMPLATE}\" \"${DATASET}\" | head -n 1`" + OLDESTSNAP="`listbookmarks \"${TEMPLATE}\" \"${DATASET}\" | $HEAD -n 1`" if [ -z "${OLDESTSNAP}" ]; then logit "Found no existing bookmark either; will send full stream." else @@ -152,7 +154,7 @@ if [ "$1" = "reinvoked" ]; then [ -z "$1" ] && exiterror "No template given." # We always save the most recent. - SNAPSTOREMOVE="`listsnaps \"${TEMPLATE}\" \"${DATASET}\" | head -n -1`" + SNAPSTOREMOVE="`listsnaps \"${TEMPLATE}\" \"${DATASET}\" | $HEAD -n -1`" if [ -z "${SNAPSTOREMOVE}" ]; then logit "No snapshots to remove." else @@ -164,7 +166,7 @@ if [ "$1" = "reinvoked" ]; then fi # We always save the most recent. - BOOKSTOREMOVE="`listbookmarks \"${TEMPLATE}\" \"${DATASET}\" | head -n -1`" + BOOKSTOREMOVE="`listbookmarks \"${TEMPLATE}\" \"${DATASET}\" | $HEAD -n -1`" if [ -z "${BOOKSTOREMOVE}" ]; then logit "No bookmarks to remove." else -- 2.30.0 From 6bda124237d1099343ebac4cdf78d87c55e8e068 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 13:27:02 +0100 Subject: [PATCH 2/8] Fix typo --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 2def548..c0adfa2 100644 --- a/debian/control +++ b/debian/control @@ -33,7 +33,7 @@ Description: Simple and powerful network transmission of ZFS snapshots simplesnap is robust in the face of interrupted transfers, and needs little help to keep running. . - nlike many similar tools, simplesnap does not + Unlike many similar tools, simplesnap does not require full root access to the machines being backed up. It runs only a small wrapper as root, and the wrapper has only three commands it implements. -- 2.30.0 From 7db7809ae9133925078b8605c97953bbf7294ad9 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 13:30:56 +0100 Subject: [PATCH 3/8] simplesnap: Fix spelling of 'parameter' --- simplesnap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplesnap b/simplesnap index 69a10cd..13283d3 100755 --- a/simplesnap +++ b/simplesnap @@ -142,7 +142,7 @@ while [ -n "$1" ]; do "--check") CHECKMODE="$2" if [ -z "$CHECKMODE" ] ; then - syntaxerror "--check requires a paremter" + syntaxerror "--check requires a parameter" fi shift 2 ;; -- 2.30.0 From 9cbec3e2ae3e43b7836b0c40a5ebb94a060af4f8 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 13:55:44 +0100 Subject: [PATCH 4/8] simplesnap: Fix spelling of 'does' --- simplesnap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplesnap b/simplesnap index 13283d3..3659ae7 100755 --- a/simplesnap +++ b/simplesnap @@ -255,7 +255,7 @@ reap () { else for REMOVAL in ${SNAPSTOREMOVE}; do logit "Destroying snapshot ${REMOVAL}" - echo "_${REMOVAL}" | $GREP -q '@' || exiterror "PANIC: snapshot name doesn not contain @" + echo "_${REMOVAL}" | $GREP -q '@' || exiterror "PANIC: snapshot name does not contain @" runzfs destroy "${REMOVAL}" done fi -- 2.30.0 From d51512658901a391e62d94b0e33f78c29bbe2f6f Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 19:52:21 +0100 Subject: [PATCH 5/8] simplesnap: Spell 'backup' without space in a log message --- simplesnap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplesnap b/simplesnap index 3659ae7..0767f62 100755 --- a/simplesnap +++ b/simplesnap @@ -229,7 +229,7 @@ checkbackups () { fi done if [ "$FOUNDOK" = "0" ]; then - echo "${CHECKDS} last back up is too old; created at `$DATE -d \"@${TSSEC}\"` but cutoff is `$DATE -d \"@${CUTOFF}\"`!" 1>&2 + echo "${CHECKDS} last backup is too old; created at `$DATE -d \"@${TSSEC}\"` but cutoff is `$DATE -d \"@${CUTOFF}\"`!" 1>&2 CHECKRETVAL=10 fi done -- 2.30.0 From 6c29c88d376fe38882b9935292e494858ae16dab Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 13:32:22 +0100 Subject: [PATCH 6/8] simplesnapwrap: Fix spelling of 'parameters' --- simplesnapwrap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simplesnapwrap b/simplesnapwrap index f8ba6f5..3009b2d 100755 --- a/simplesnapwrap +++ b/simplesnapwrap @@ -67,14 +67,14 @@ listbookmarks () { PATTERN="^[a-zA-Z0-9_/. -]\+\$" if [ "$1" = "reinvoked" ]; then shift - logit "Reinvoked with paramaters \"$*\"" + logit "Reinvoked with parameters \"$*\"" shift # Drop the call to simplesnapwrap # Validate again. Just to be sure. echo ".$*" | $GREP -q "${PATTERN}" || exiterror "Invalid characters found on re-validate; pattern is ${PATTERN}" echo ".$*" | $GREP -vq '\.\.' || exiterror "Found .. in input; aborting." - # We don't want any paramaters to contain a space or leading dash. + # We don't want any parameters to contain a space or leading dash. for ARG; do echo ",${ARG}" | $GREP -vq '^,-' || exiterror "Found leading '-' in parameter \"${ARG}\"; aborting." echo ",${ARG}" | $GREP -vq ' ' || exiterror "Found space in parameters; aborting." -- 2.30.0 From 1a15805b60962cd84703e68c5b92f00fdb07b809 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 13:35:05 +0100 Subject: [PATCH 7/8] doc/simplesnap.sgml: Fix spelling of 'which' --- doc/simplesnap.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/simplesnap.sgml b/doc/simplesnap.sgml index 677b928..0c5099e 100644 --- a/doc/simplesnap.sgml +++ b/doc/simplesnap.sgml @@ -531,7 +531,7 @@ no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAA.... DEST Valid only with , gives a - specific destination for the backup, whith may be outside + specific destination for the backup, which may be outside the STORE. The STORE must still exist, as it is used for storing lockfiles and such. -- 2.30.0 From 921aefe906a59bfd556045f256c9f1189738b662 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 30 Dec 2020 13:35:54 +0100 Subject: [PATCH 8/8] doc/simplesnap.sgml: Fix spelling of 'referencing' --- doc/simplesnap.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/simplesnap.sgml b/doc/simplesnap.sgml index 0c5099e..ae463c5 100644 --- a/doc/simplesnap.sgml +++ b/doc/simplesnap.sgml @@ -808,7 +808,7 @@ NAME USED AVAIL REFER three hours yesterday, each snapshot could very well show less than 100KB used, because that 100MB isn't unique to a particular snapshot. Until, that is, two of the three - snapshots referncing the 100MB data are destroyed; then the + snapshots referencing the 100MB data are destroyed; then the USED value of the last one referencing it will suddenly jump to 100MB higher because now it references unique data. -- 2.30.0