From b6d7f8571d5f083d84e1d2424756e9282fa2b5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Sat, 21 Dec 2024 03:55:04 -0500 Subject: [PATCH] cleanup: Don't remove images/backups volume MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- bin/cleanup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cleanup b/bin/cleanup index 280e2886b..38daf62ce 100755 --- a/bin/cleanup +++ b/bin/cleanup @@ -4,7 +4,7 @@ if [ "${1:-}" = "force" ]; then if incus info >/dev/null 2>&1; then incus list -cn -f csv | grep -v ^cache- | xargs -r incus delete -f incus image list -cF -fcsv | xargs -r incus image delete - incus admin sql global "DELETE FROM storage_volumes WHERE name NOT LIKE 'cache-%'" + incus admin sql global "DELETE FROM storage_volumes WHERE name NOT LIKE 'cache-%' AND name NOT IN ('images', 'backups')" rm -Rf /var/log/incus/* for i in $(zfs list -o name -r default/containers | grep containers/ | grep -v containers/cache-); do zfs destroy -R "$i"; done