Backup all docker volumes to a tar.gz file on a SFTP box. (Load SFTP's pass with read -s
).
Backup container volumes
infraopsBackup all docker volumes to a tar.gz file on a SFTP box. (Load SFTP's pass with read -s
).
vols=$(
for container_id in $(docker ps -a|cut -d\ -f1|grep -v CONTAINER)
do
docker inspect "$container_id" |jq .[].Mounts[].Source -r
done |sort|uniq
)
tar cz $vols | curl -T - -u u289910:$PASS sftp://u289910.your-storagebox.de/backups/$(date +%d).tar.gz