From 13956bbc4d1115ec1fa2d7b514534b2e6a627a7c Mon Sep 17 00:00:00 2001 From: Johannes Randerath AS ROOT Date: Fri, 10 May 2024 13:15:27 +0200 Subject: [PATCH] backup-20240510-13h15 --- backup_git.sh | 1 + push_backup_git.sh | 5 +++-- root_backup_git.sh | 1 + user_backup_git.sh | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backup_git.sh b/backup_git.sh index 0ca2326..aaccd68 100644 --- a/backup_git.sh +++ b/backup_git.sh @@ -19,3 +19,4 @@ sudo chown -R johannes:johannes .git >> $LOGFILE git push >> $LOGFILE popd echo "--------------------------------------------------------------------" >> $LOGFILE +unset DATE LOGFILE repo diff --git a/push_backup_git.sh b/push_backup_git.sh index 0bdfc8d..44e4e4c 100644 --- a/push_backup_git.sh +++ b/push_backup_git.sh @@ -2,8 +2,9 @@ DATE=$(date +%Y%m%d-%Hh%M) LOGFILE=/home/johannes/.var/log/push-backup-${DATE}.log for d in $(find -type d -name '.jr_backup'); do - printf "%s: " $repo >> $LOGFILE - git -C ${repo}/.. push origin main >> $LOGFILE 2>&1 + printf "%s: " $d >> $LOGFILE + git -C $d/.. push origin main >> $LOGFILE 2>&1 printf "\n" >> $LOGFILE done git -C /etc push origin main >> $LOGFILE 2>&1 +unset DATE LOGFILE d diff --git a/root_backup_git.sh b/root_backup_git.sh index 04f3ae2..47b5a03 100644 --- a/root_backup_git.sh +++ b/root_backup_git.sh @@ -5,3 +5,4 @@ touch $LOGFILE sudo git -C /etc add /etc >> $LOGFILE 2>&1 sudo git -C /etc commit -m "backup-$DATE" >> $LOGFILE 2>&1 sudo chown -R johannes:johannes /etc/.git >> $LOGFILE 2>&1 +unset DATE LOGFILE diff --git a/user_backup_git.sh b/user_backup_git.sh index 3b9ad5d..6bbb476 100644 --- a/user_backup_git.sh +++ b/user_backup_git.sh @@ -12,3 +12,4 @@ for repo in $(find /home/johannes -type d -name '.jr_backup'); do printf "\n\n\n" >> $LOGFILE done echo "--------------------------------------------------------------------" >> $LOGFILE +unset DATE LOGFILE repo