diff --git a/README.md b/README.md index c73ee8e2fdddb3ee9cccd5b480abc51ce50cf4df..f4efaeeeec64abc654c507efb47648d679495d20 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # IML BACKUP # -Backup scripts using duplicity. +Backup scripts using restic or duplicity. Runs on Linux. -Free software. GNU GPL 3.0. - -Source: <https://git-repo.iml.unibe.ch/iml-open-source/iml-backup/> -Duplicity: <http://duplicity.nongnu.org/> +* Free software. GNU GPL 3.0 +* Source: <https://git-repo.iml.unibe.ch/iml-open-source/iml-backup/> +* Restic: <https://restic.net/> +* Duplicity: <http://duplicity.nongnu.org/> ## Why ## diff --git a/jobhelper.sh b/jobhelper.sh index 5f454780f09678ff98b3ed049a357656b72a0115..f1b66b6df88aa65aef9b4bdb375ea13d845252bf 100755 --- a/jobhelper.sh +++ b/jobhelper.sh @@ -73,7 +73,7 @@ function j_init(){ # for date definitions like weekdays JOBDEF_LANG=`_j_getvar ${JOBFILE} "lang"` - if [ -z $JOBDEF_LANG ]; then + if [ -z "$JOBDEF_LANG" ]; then JOBDEF_LANG="en_us" fi export LANG=$JOBDEF_LANG diff --git a/plugins/transfer/restic.sh b/plugins/transfer/restic.sh index 79aebea8a879476977b2f2bbd13ff78f79736b25..dba32a6ddaa83ec6f8d8fa7c517d7b1eb43e3918 100644 --- a/plugins/transfer/restic.sh +++ b/plugins/transfer/restic.sh @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------------- # ah - Axel Hahn <axel.hahn@iml.unibe.ch> # 2021-05-19 ah v0.0 INIT ... WIP +# 2022-01-06 ah v0.0 added support for Repository with REST and authentication # ================================================================================ # -------------------------------------------------------------------------------- @@ -25,7 +26,16 @@ # if we set RESTIC_REPOSITORY then "-r TARGET" is not # needed in restic commands - export RESTIC_REPOSITORY=$( j_getFullTarget ) + + # TODO: for restic with https and auth - remove the host in the path + local _target=$( j_getFullTarget ) + echo ${_target} | grep "https.*@" >/dev/null + if [ $? -eq 0 ]; then + local _host=$( hostname -f ) + _target=$( echo $_target | sed "s#${_host}/##" ) + fi + + export RESTIC_REPOSITORY=$_target # WORKAROUND for bug while writing on a SMB target export GODEBUG="asyncpreemptoff=1"