various
parent
4707b00867
commit
439e69fb78
|
@ -225,20 +225,30 @@ download_restic 0.16.0
|
||||||
test_file "$restic_repo_file"
|
test_file "$restic_repo_file"
|
||||||
test_file "$restic_repo_passwd_file"
|
test_file "$restic_repo_passwd_file"
|
||||||
|
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" || -f "$1" ]]; then
|
||||||
say info "Running backup scripts..."
|
if [[ -z "$1" ]]; then
|
||||||
|
say info "Running backup scripts..."
|
||||||
|
|
||||||
if ! [[ "$(ls -A $backup_scripts_dir)" ]]; then
|
if ! [[ "$(ls -A $backup_scripts_dir)" ]]; then
|
||||||
die "No scripts found in '$backup_scripts_dir'"
|
die "No scripts found in '$backup_scripts_dir'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for backup_script in $backup_scripts_dir/*; do
|
||||||
|
invoke_script $backup_script
|
||||||
|
done
|
||||||
|
else
|
||||||
|
say info "Running script: $(basename "$1")"
|
||||||
|
invoke_script "$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for backup_script in $backup_scripts_dir/*; do
|
|
||||||
invoke_script $backup_script
|
|
||||||
done
|
|
||||||
|
|
||||||
say primary "$(repeat "-" 80)"
|
say primary "$(repeat "-" 80)"
|
||||||
elif [[ -f "$1" ]]; then
|
|
||||||
invoke_script "$1"
|
invoke_restic snapshots \
|
||||||
|
--compact \
|
||||||
|
--latest 1 \
|
||||||
|
--host "$host" \
|
||||||
|
--tag "$(basename "$0")" \
|
||||||
|
| sed -E ":begin;$!N;s/$(basename "$0")\n\s+?//;tbegin;P;D"
|
||||||
else
|
else
|
||||||
command="$1"
|
command="$1"
|
||||||
arguments="${@:2}"
|
arguments="${@:2}"
|
||||||
|
|
Loading…
Reference in New Issue