diff --git a/logs/.gitkeep b/logs/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/transfer.sh b/transfer.sh index 04095e14029d6806c66925d45084ddc49d900110..19de81db6068b1c9fd4aa26c8d94a0cb66632bd9 100755 --- a/transfer.sh +++ b/transfer.sh @@ -28,6 +28,7 @@ # 2018-06-19 ah,ds v1.6 replace --exclude with --exclude regexp in custom dirs # 2019-06-05 ah,ds v1.7 add custom cache dir # 2019-09-09 ah,ds v1.8 add testfile on target +# 2019-10-30 ah,ds v1.9 for rsync targets: create remote target dir with ssh command # ================================================================================ @@ -257,20 +258,27 @@ fi # ---------- ENDE -------------------- - - # --- "trick": create remote directory by checking collection status - # with switching to "scp" - # rsync://backupuser@mystorage//backupdir/hostname/jobname - + # --- for rsync only: create remote directory echo ${sTarget} | fgrep "rsync://" >/dev/null if [ $? -eq 0 ]; then - sshTarget=`echo ${sTarget} | sed "s#rsync://#scp://#"` - echo Creating remote directory with fetching collection-status on $sshTarget + # sshTarget=`echo ${sTarget} | sed "s#rsync://#scp://#"` + # echo Creating remote directory with fetching collection-status on $sshTarget + # color cmd + # duplicity collection-status ${sParams} ${sshTarget} + # color reset + sshTarget=`echo ${sTarget} | cut -f 3 -d '/'` + RemoteDir=`echo ${sTarget} | cut -f 4- -d '/'` + cmd="ssh" + if [ ! -z ${sFileSshPrivkey} ]; then + cmd="${cmd} -i ${sFileSshPrivkey}" + fi + cmd="${cmd} ${sshTarget} mkdir -p ${RemoteDir} 2>/dev/null ; ls -ld ${RemoteDir} " + echo Creating remote directory first ... color cmd - duplicity collection-status ${sParams} ${sshTarget} - color reset + $cmd + color reset fi - + # --- backup echo backup to target: ${sTarget} echo duplicity ${METHOD} ${sBackupParams} ${mydir} ${sTarget}