- Mitglied seit
- 28. Okt 2020
- Beiträge
- 15.028
- Punkte für Reaktionen
- 5.401
- Punkte
- 564
Ich sichere das mit Docker-Autocompose:
Bash:
#!/bin/bash
# anzupassen:
BackUpDir="/volume1/docker/Backup"
IgnoredContainer=(jitsi_jicofo jitsi_jvb jitsi_prosody jitsi_web synology_docviewer_2 synology_docviewer_1)
#–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
for container in $(docker ps --format "{{ .Names }}"); do
if grep -q "${container}" <<< "${IgnoredContainer[@]}" ; then
echo "${container} is on ignore list. Skipping this container."
continue
else
echo "${container} export"
# YAML:
# https://www.synology-forum.de/threads/docker-container-automatische-docker-compose-file-erstellen-als-backup.110444/post-897496
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose "${container}" > "${BackUpDir}/${container}_$(date +%Y-%m-%d_%H-%M).yml"
fi
done
exit