This is not a direct solution for the issue. It is an alternate method which I think is more efficient for backing up multiple sites or multiple benches.
I run bench --site all backup and restic backup sites commands from given bench to take database backups and have incremental snapshots of files including db dumps moved to s3 as a restic repository.
It reduced size of backups when I moved to restic snapshots. Before restic I archived the files and pushed them to s3 as well. It was time consuming and inefficient, it created copies of files in archives. With restic I keep last 30 snapshots, I take them every 12 hrs, it means I have snapshot of last 15 days and backup size is less than what it was when I was doing it without restic.
example cron / script you will have to run.
# Switch working directory to frappe-bench
cd /path/to/frappe-bench
# backup db only
bench --site all backup
# list previous restic snapshots or init restic
restic snapshots || restic init
# backup files including db dumps
restic backup sites
# cleanup snapshots
restic forget --group-by=paths --keep-last=30 --prune
Thanks for that. It’s way beyond my paygrade though I just have to fill in while S3 is failing.
To help anyone else. I eventually discovered that before being parcelled up for S3, ERPNext seems to store the backups in: frappe/frappe-bench/sites//private/backups
So it’s quite easy to pull the files from there for offsite backup as a stopgap.