Compare commits

..

1 Commits

Author SHA1 Message Date
julien 07c189e962 Add zfs-auto-snapshot.sh script 2025-12-08 16:14:46 +01:00
4 changed files with 6 additions and 5 deletions
-1
View File
@@ -6,4 +6,3 @@ Some helpful bash scripts for [incus](https://linuxcontainers.org/incus)
- incus-backup: Backup instances FS and DBs to a remote location using rsync over ssh.
- incus-copy: Run a differential copy of all running instances to a remote incus server.
- incus-snapshot: Take a snapshot on all running instances.
- zfs-auto-snapshot: Create and cleanup expired zfs snapshots.
+3
View File
@@ -35,4 +35,7 @@
"DB": ["spot"],
"FS": ["/var/www"]
},
"wedding": {
"FS": ["/var/www/mariage"]
}
}
-1
View File
@@ -7,7 +7,6 @@ distUpgrade() {
DATE=$(date '+%Y-%m-%d %H:%M:%S')
echo -e "\n*** [$DATE] - Dist-upgrading $CT container ***\n"
incus exec $CT --env DEBIAN_FRONTEND=noninteractive -- apt -qq update
incus exec $CT --env DEBIAN_FRONTEND=noninteractive -- apt list --upgradable
incus exec $CT --env DEBIAN_FRONTEND=noninteractive -- apt -qq -y dist-upgrade
}
+3 -3
View File
@@ -20,10 +20,10 @@ TS=$(date '+%s')
ZFS=$(which zfs)
CMD="$ZFS snapshot ${DATASET}@snap${TS}"
echo "[${DATE}] $CMD"
$CMD 2>&1
$CMD 2>&1 > /dev/null
ZFS_PRUNE_SNAPSHOTS=$(which zfs-prune-snapshots)
CMD="$ZFS_PRUNE_SNAPSHOTS -p snap $EXPIRATION $DATASET"
CMD="$ZFS_PRUNE_SNAPSHOTS -p 'snap' $EXPIRATION $DATASET"
echo "[${DATE}] $CMD"
$CMD 2>&1
$CMD 2>&1 > /dev/null