This commit is contained in:
James 2024-03-29 10:11:55 +00:00
parent 3358e4ef07
commit fce0617eb1

View File

@ -16,10 +16,10 @@ tail -n0 --pid="$$" -f "$dst/next.log" &
# Loop until rsync is successful or the user decides to abort # Loop until rsync is successful or the user decides to abort
while :; do while :; do
if rsync "${args[@]}" -av --link-dest="$dst/current" "$src/" "$dst/next" 2>&1 >> "$dst/next.log"; then if rsync "${args[@]}" -av --link-dest="$dst/current" "$src/" "$dst/next" 2>&1 >> "$dst/next.log"; then
echo "Backup successful." echo -e "\033[32mBackup successful.\033[0m" # Green color for success
break break
else else
echo "Backup failed." echo -e "\033[31mBackup failed.\033[0m" # Red color for error
# Ask the user for the next step # Ask the user for the next step
echo "Do you want to retry, abort, or continue? [r/a/c]" echo "Do you want to retry, abort, or continue? [r/a/c]"
read -r response read -r response