From 517777f38f73f32963e65c90394afdbbc89ac2d2 Mon Sep 17 00:00:00 2001 From: rick Date: Sat, 16 Oct 2021 00:57:19 +0200 Subject: [PATCH] instead of cloning we stop containers now cause with big containers we need way to much diskspace for clones. also the backup job runs at night were no one uses these containers so they can be stopped without a problem --- lxc_backup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lxc_backup.sh b/lxc_backup.sh index c18e88c..e744ea5 100755 --- a/lxc_backup.sh +++ b/lxc_backup.sh @@ -23,9 +23,9 @@ fi #only backup container which contain a 1 at the end of the line for container in $(${lxccmd} list --format csv -c n | grep "1$"); do - ${lxccmd} copy ${container} ${container}-backup - ${lxccmd} export ${container}-backup ${backuppath}$(date +%Y_%m_%d)-lxc-${container}.tar.gz --instance-only --optimized-storage - ${lxccmd} delete ${container}-backup + ${lxccmd} stop ${container} + ${lxccmd} export ${container} ${backuppath}$(date +%Y_%m_%d)-lxc-${container}.tar.gz --instance-only --optimized-storage + ${lxccmd} start ${container} done #housekeeping - keep last 14 days