From ba0ba2333d12940571d0e2706679ac9d91686086 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 4 Sep 2023 15:16:08 -0500 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 53253f86..bb424d07 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -575,19 +575,21 @@ BACKUP_OFFSITEPFSENSE(){ BAKFOLDER=/mnt/BU-Raid1.new/Offsite-pfSense_Backups newBAKFOLDER=${BAKFOLDER}/`date +%Y%m%d-%H%M%S` mkdir ${newBAKFOLDER} + DOM='01' + DOW='1' ssh root@10.2.1.1 tar -c -f /cf/conf/conf_backup.tar.gz /cf/conf scp root@10.2.1.1:/cf/conf/conf* ${newBAKFOLDER}/ ssh root@10.2.1.1 rm -f /cf/conf/conf_backup.tar.gz - if [ "$(date +%d)" == "04" ] && [ "$(date +%u)" == "1" ]; then + if [ "$(date +%d)" == "${DOM}" ] && [ "$(date +%u)" == "${DOW}" ]; then mv ${newBAKFOLDER} "${newBAKFOLDER}-M" ln -s "${newBAKFOLDER}-M" "${newBAKFOLDER}-W" ln -s "${newBAKFOLDER}-M" "${newBAKFOLDER}-D" - elif [ "$(date +%d)" == "04" ]; then + elif [ "$(date +%d)" == "${DOM}" ]; then mv ${newBAKFOLDER} "${newBAKFOLDER}-M" ln -s "${newBAKFOLDER}-M" "${newBAKFOLDER}-D" - elif [ "$(date +%u)" == "1" ]; then + elif [ "$(date +%u)" == "${DOW}" ]; then mv ${newBAKFOLDER} "${newBAKFOLDER}-W" ln -s "${newBAKFOLDER}-W" "${newBAKFOLDER}-D" else