From 2da9a58b6fe65df086c6655692b22a3b2baa2fd2 Mon Sep 17 00:00:00 2001 From: Steffen Ritter Date: Mon, 16 May 2022 15:06:11 +0200 Subject: [SSPS] Add simple weekly config backup Do an admin a favor who screws up his config and has not made a backup on his own. Maybe extend that feature later. refs: #3834 --- .../static_files/system/etc/cron.weekly/backup-satconfig.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 satellit_installer/static_files/system/etc/cron.weekly/backup-satconfig.sh 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 {} \; -- cgit v1.2.3-55-g7522