From 14122a7fd73887ffcff75de8db77fa5ecfb03521 Mon Sep 17 00:00:00 2001 From: Enrico Ludwig Date: Mon, 13 May 2024 12:57:10 +0200 Subject: [PATCH] Fixed --first-backup not working --- borgmatic_setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/borgmatic_setup.sh b/borgmatic_setup.sh index 449df07..c2566b5 100755 --- a/borgmatic_setup.sh +++ b/borgmatic_setup.sh @@ -840,9 +840,9 @@ if ! inf_follow "Checking for cronjob..." "\e[1;32mYes\e[0m" "\e[1;31mNo\e[0m" c fi fi -if [ -z $AUTO ]; then - if [ -z $FIRST_BACKUP ] && infp "Do you want to run the first backup now? [y/N]"; then - if ! inf_follow "Running first backup..." "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" run_command /root/.local/pipx/venvs/borgmatic/bin/borgmatic create --verbosity 1 --list --stats; then +if [ $FIRST_BACKUP -eq 1 ]; then + if [ $AUTO -eq 1 ] || infp "Do you want to run the first backup now? [Y/n]"; then + if ! inf_follow "Running first backup (this may take a while!)..." "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" run_command /root/.local/pipx/venvs/borgmatic/bin/borgmatic create --verbosity 1 --list --stats; then err "Failed to run first backup." err "If the error persists, please contact the support at $SCRIPT_SUPPORT." exit 1