bundles/backup-client: rework backup generation
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
4e5cb69d1c
commit
14e4415e5f
6 changed files with 159 additions and 107 deletions
22
bundles/backup-client/files/generate-backup-with-retries
Normal file
22
bundles/backup-client/files/generate-backup-with-retries
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Try generating a backup multiple times. If one attempt succeeds, we're
|
||||
# done. If not, there will be logs for every attempt, plus monitoring
|
||||
# will read the result of the last backup.
|
||||
for try in {1..3}
|
||||
do
|
||||
generate-backup "$try"
|
||||
exitcode=$?
|
||||
|
||||
if [[ $exitcode -eq 100 ]]
|
||||
then
|
||||
# fatal error, cannot recover
|
||||
exit 1
|
||||
elif [[ $exitcode -eq 0 ]]
|
||||
then
|
||||
# successful backup
|
||||
exit 0
|
||||
else
|
||||
sleep 60
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue