diff --git a/libexec/kiwi-backup/build_command b/libexec/kiwi-backup/build_command index 6232c11..14cb7bc 100755 --- a/libexec/kiwi-backup/build_command +++ b/libexec/kiwi-backup/build_command @@ -25,11 +25,6 @@ fi if [ -n "${GPG_KEY_ID}" ]; then # gpg key given options_encryption="--encrypt-key=${GPG_KEY_ID}" - - # handle more verbose "GPG_PASSPHRASE" env_var - PASSPHRASE="${GPG_PASSPHRASE:-${PASSPHRASE}}" - export PASSPHRASE - unset GPG_PASSPHRASE else # no key given options_encryption="--no-encryption" diff --git a/libexec/kiwi-backup/run_command b/libexec/kiwi-backup/run_command new file mode 100755 index 0000000..4025b30 --- /dev/null +++ b/libexec/kiwi-backup/run_command @@ -0,0 +1,27 @@ +#!/bin/sh + +this_script="$( readlink -f "${0}" )" +this_dir="${this_script%/*}" + +# files +duplicity_secrets_file="/root/duplicity_secrets" + +# load secrets file +if [ -f "${duplicity_secrets_file}" ]; then + # shellcheck disable=SC1090 + . "${duplicity_secrets_file}" +fi + +# handle more verbose "GPG_PASSPHRASE" env var +if [ -n "${GPG_PASSPHRASE}" ]; then + PASSPHRASE="${GPG_PASSPHRASE:-${PASSPHRASE}}" + export PASSPHRASE + unset GPG_PASSPHRASE +fi + +# hand over +set -ex +exec $( \ + "${this_dir}/build_command" \ + "${@}" \ +) diff --git a/libexec/kiwi-backup/scheduler b/libexec/kiwi-backup/scheduler index 9226a14..c88ff24 100755 --- a/libexec/kiwi-backup/scheduler +++ b/libexec/kiwi-backup/scheduler @@ -3,14 +3,14 @@ this_script="$( readlink -f "${0}" )" this_dir="${this_script%/*}" -echo "${SCHEDULE_BACKUP}" "$( "${this_dir}/build_command" backup )" \ +echo "${SCHEDULE_BACKUP}" "${this_dir}/run_command backup" \ | /usr/local/libexec/kiwi-cron/randomize_schedule -echo "${SCHEDULE_CLEANUP}" "$( "${this_dir}/build_command" cleanup )" \ +echo "${SCHEDULE_CLEANUP}" "${this_dir}/run_command cleanup" \ | /usr/local/libexec/kiwi-cron/randomize_schedule -echo "${SCHEDULE_RMFULL}" "$( "${this_dir}/build_command" rmfull )" \ +echo "${SCHEDULE_RMFULL}" "${this_dir}/run_command rmfull" \ | /usr/local/libexec/kiwi-cron/randomize_schedule -echo "${SCHEDULE_RMINCR}" "$( "${this_dir}/build_command" rmincr )" \ +echo "${SCHEDULE_RMINCR}" "${this_dir}/run_command rmincr" \ | /usr/local/libexec/kiwi-cron/randomize_schedule