(Alternative product recommendation, please downvote/remove if you feel that isn't appropriate) For Unix/Linux backups, may I suggest Borg Backup? It encrypts and does dedupe astonishingly well. It also works over SSH incredibly fast, and restores are via a mounted FUSE filesystem so they're easy to pick and choose what you need. It prunes really well too, and is a single executable so it's easy to distribute via Ans…
set -euo Pipefail
if "${DEBUG:-false}”; then set -x; fi
The -o Pipefail is irrelevant in this case, as you're not using any.. but better it's there in case you ever extend the script.As others have pointed out: readability comes right after correctness in shell script, do keeping it simple as you have done is always a good idea.