DONE

Backup container volumes

infraops

%3 cluster_509dc055_91b1_48c4_b8cb_7b79794f826c Backup container volumes _ff5c276f_5eec_4b59_9962_c092a240b068 December Adventure 2024 _ff5c276f_5eec_4b59_9962_c092a240b068->__0:cluster_509dc055_91b1_48c4_b8cb_7b79794f826c

Backup 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