I was hoping to use Tarsnap to externally backup the data on some of my apps/volumes. I imagine I could achieve this in a semi-roundabout way by writing a script that leverages flyctl to ssh into each app, install tarsnap if it isn’t there, and finally list and backup the volumes.
Any issues with this approach? Other ideas people have implemented?
I made a separate vm in each org to run backups. Another alternative, you could also just install tarsnap into every docker image and have a cron job for the volumes run in the vm.
Could you possibly elaborate or link to how your backup VM works? I imagine it’s a service that connects to running fly apps and follows roughly the same process I described for a theoretical script, but I would be interested to see exactly how you solved it in practice
expiry="90 days"
s3cmd ls s3://${ORG}-backup | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-${expiry}" +%s`
if [[ $createDate -lt $olderThan ]]
then
fileName=`echo $line|awk {'print $4'}`
echo $fileName
if [[ $fileName != "" ]]
then
s3cmd del "$fileName"
fi
fi
done;