From 1a68f32df6e6edc5a802e0a8ae6905653de26fc8 Mon Sep 17 00:00:00 2001 From: rick Date: Tue, 27 Aug 2019 19:43:52 +0200 Subject: [PATCH] added houskeeping and new backuppath --- lxc_backup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lxc_backup.sh b/lxc_backup.sh index 6e76172..dbd510f 100755 --- a/lxc_backup.sh +++ b/lxc_backup.sh @@ -2,7 +2,7 @@ #this script makes a copy of each container and backups afterwards the copies #set -x -backuppath='/home/rick-monitoring/backup/' +backuppath='/srv/backUP/lxc' backupuser='rick-monitoring' lxccmd='/snap/bin/lxc' @@ -27,5 +27,8 @@ do ${lxccmd} delete ${container}-backup done +#housekeeping - keep last 38 days +find ${backuppath} -mtime +38 -exec rm -f ${backuppath}/{} ;\ + #own data for backupuser chown -R ${backupuser}:${backupuser} ${backuppath}