mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-09 12:22:40 +01:00
Fix(restic) catch attempt failure
Failure was reported even when the last attempt was successful.
This commit is contained in:
parent
b09529e96b
commit
ff61e65be4
@ -71,12 +71,17 @@ function export_debug {
|
||||
|
||||
function run_cmd {
|
||||
local pass=0
|
||||
local cmd=$1
|
||||
while [ $pass -lt $retry_run ]; do
|
||||
(( pass++ ))
|
||||
debug "Attempt $pass"
|
||||
$1 && break
|
||||
# return when cmd succeeded, pass when failed
|
||||
$cmd && return 0 || :
|
||||
sleep $retry_wait
|
||||
done
|
||||
|
||||
# if we reach here, we have failed
|
||||
return 1
|
||||
}
|
||||
|
||||
### GLOBAL OPTIONS ############################################################
|
||||
|
Loading…
Reference in New Issue
Block a user