all containers exept with a 0 at the and should be backed up

This commit is contained in:
rick
2022-01-26 22:57:35 +01:00
parent 34b9729d3a
commit 9c91dc660e

View File

@@ -20,8 +20,8 @@ then
exit 2 exit 2
fi fi
#only backup container which contain a 1 at the end of the line #only backup container which doesn't contain a 0 at the end
for container in $(${lxccmd} list --format csv -c n | grep "1$"); for container in $(${lxccmd} list --format csv -c n | grep -v "0$");
do do
${lxccmd} stop ${container} ${lxccmd} stop ${container}
${lxccmd} export ${container} ${backuppath}$(date +%Y_%m_%d)-lxc-${container}.tar.gz --instance-only ${lxccmd} export ${container} ${backuppath}$(date +%Y_%m_%d)-lxc-${container}.tar.gz --instance-only