summaryrefslogtreecommitdiffstats
path: root/satellit_installer/static_files/system/etc/cron.weekly/backup-satconfig.sh
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_installer/static_files/system/etc/cron.weekly/backup-satconfig.sh')
-rwxr-xr-xsatellit_installer/static_files/system/etc/cron.weekly/backup-satconfig.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/satellit_installer/static_files/system/etc/cron.weekly/backup-satconfig.sh b/satellit_installer/static_files/system/etc/cron.weekly/backup-satconfig.sh
new file mode 100755
index 0000000..ae97535
--- /dev/null
+++ b/satellit_installer/static_files/system/etc/cron.weekly/backup-satconfig.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+DIR="/root/backup/"
+BACKUP_FILE=$(/opt/taskmanager/scripts/system-backup | tail -n 1 | cut -d' ' -f 2)
+
+mkdir -p "$DIR"
+cd "$DIR" || exit 1
+
+mv $BACKUP_FILE $DIR
+
+# remove backups older than 180 days
+find $DIR/*.tgz -type f -mtime +180 -exec rm -f {} \;