It's really just those three steps in a loop, nothing fancy
SHOT_TIME="$(date +'%Y-%m-%d_%H-%M')"
for dir in /docker/*
do
cd $dir;
btrfs subvolume snapshot "${dir}" "/docker/.snapshots/$(basename $dir)-${SHOT_TIME}"
docker compose pull --quiet
docker compose up -d
done
I mount a btrfs subvolume at /docker, and create a .snapshots subvolume inside.
Each subvolume is an app and its dependencies, you want everything snapshotted as one. This is probably the biggest pitfall, if you don't take that snapshot of all the pieces.
Each subvolume is an app and its dependencies, you want everything snapshotted as one. This is probably the biggest pitfall, if you don't take that snapshot of all the pieces.