Think about using the trap ERR idiom in bash to handle errors. The downside here is that this makes it hard to print nice error messages (especially localized) since the error handling / trap function won't know where the error is coming from.
Still think about
[ ] restoring stat.txt on error (depending on where the error happened)
[ ] destroy/create snapshots created in the process, s.t. it's possible to run the backup script again without error.
Think about using the
trap ERR
idiom in bash to handle errors. The downside here is that this makes it hard to print nice error messages (especially localized) since the error handling / trap function won't know where the error is coming from.Still think about
stat.txt
on error (depending on where the error happened)