zio-backup: fix various runtime errors
parent
1d01e9efa7
commit
571b21326c
|
@ -4,7 +4,7 @@ env_dir=$1
|
||||||
base_dir="$(dirname "$(realpath -s "$0")")"
|
base_dir="$(dirname "$(realpath -s "$0")")"
|
||||||
root_dir="$base_dir/../../.."
|
root_dir="$base_dir/../../.."
|
||||||
|
|
||||||
[[ -z $env_dir ]] && env_dir="/etc/zio/backup/"
|
[[ -z $env_dir ]] && env_dir="/etc/zio/backup"
|
||||||
|
|
||||||
function restic_exec() {
|
function restic_exec() {
|
||||||
command="$1"
|
command="$1"
|
||||||
|
@ -151,7 +151,7 @@ fi
|
||||||
if [[ -z $b2_account_id ]]; then
|
if [[ -z $b2_account_id ]]; then
|
||||||
say_die "B2_ACCOUNT_ID (in $env_dir/config) not set. Aborting..."
|
say_die "B2_ACCOUNT_ID (in $env_dir/config) not set. Aborting..."
|
||||||
else
|
else
|
||||||
export B2_ACCOUNT_ID="$b2_account_ID"
|
export B2_ACCOUNT_ID="$b2_account_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $b2_account_key ]]; then
|
if [[ -z $b2_account_key ]]; then
|
||||||
|
@ -160,7 +160,7 @@ else
|
||||||
export B2_ACCOUNT_KEY="$b2_account_key"
|
export B2_ACCOUNT_KEY="$b2_account_key"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f $pre_script_file ]]; then
|
if [[ -f $pre_script_file ]]; then
|
||||||
say_do "Executing pre-backup script..."
|
say_do "Executing pre-backup script..."
|
||||||
. $pre_script_file
|
. $pre_script_file
|
||||||
fi
|
fi
|
||||||
|
@ -183,7 +183,7 @@ do
|
||||||
systemctl start $service
|
systemctl start $service
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ ! -z $post_script_file ]]; then
|
if [[ -f $post_script_file ]]; then
|
||||||
say_do "Executing post-backup script..."
|
say_do "Executing post-backup script..."
|
||||||
. $post_script_file
|
. $post_script_file
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue