Skip to content
Snippets Groups Projects
Commit a565af62 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

v1.9 for rsync targets: create remote target dir with ssh command

parent a6245004
No related branches found
No related tags found
No related merge requests found
......@@ -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,17 +258,24 @@
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}
$cmd
color reset
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment