Bug fix; the "month of the key" is 6 characters from index 0
[rrq/buckap.git] / dupltool
index c72b2c7618f6bd94ce809b6e9c2aadd52d354421..b7fb409573f0968a5658f9a13b8b9f56108a9482 100755 (executable)
--- a/dupltool
+++ b/dupltool
@@ -43,14 +43,15 @@ THISMONTH="$(date -u "+%Y%m")" # UTC date
 SFTP="${STORE##pexpect+scp://}"
 HOST="${SFTP%%/*}"
 REMOTEDIR="${SFTP#*/}"
-SFTP="sftp://$SFTP"
+SFTP="sftp://$SFTP" # openssh-client=1:8.4p1-5+deb11u1
+#SFTP="$HOST:$REMOTEDIR" # openssh-client=1:7.6p1-4ubuntu0.7
 
 # Obtain remote pathnames with from-to prefix in reverse date order,
 # i.e., newest first.
 FILES=( $(remote_from_to_month_prefix) )
 
 if [ -n "$FILES" ] ; then
-    THATMONTH="${FILES[0]:6:6}" # to-month of newest
+    THATMONTH="${FILES[0]:0:6}" # to-month of newest
     if [ "$THISMONTH" != "$THATMONTH" ] ; then
        echo "** New monthly snapshot; stashing daily into .$THATMONTH" >&2
        { # Generate command stream for sftp