From 8cf58ee9eecf289e069017f451dc107e49bebed3 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 16:57:22 -0700 Subject: [PATCH 01/14] backup script --- backup-bap | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 backup-bap diff --git a/backup-bap b/backup-bap new file mode 100644 index 0000000..e8e5d73 --- /dev/null +++ b/backup-bap @@ -0,0 +1,39 @@ +#!/bin/bash +echo -e "BAP Backup utility \n" +# Where to backup +BACKUP_PATH="/tmp" +MOUNT_POINT="/media/usb" + +#check if mount point exists +if [ ! -d “MOUNT_POINT” ] ; then + echo "USB not found" +else + echo "USB here do the work" +fi + +# What to backup. remember the \ for new line continuation last tine has none +backup_files="${HOME}/pi-build \ +${HOME}/.config \ +${HOME}/.fl* \ +${HOME}/.xastir \ +${HOME}/.wine/drive_c/VARA/VARA.ini \ +${HOME}/Desktop \ +${HOME}/qsstv \ +${HOME}/.conkyrc \ +${HOME}/*.*" + +# archive filename +day=$(date +%A) +hostname=$(hostname -s) +archive_file="BAP-Backup-$hostname-$day.tgz" + +# Print start status message. +echo -e "\nBacking up $backup_files to $BACKUP_PATH/$archive_file \n\n" +date + +# Backup the files using tar. +tar czf $BACKUP_PATH/$archive_file $backup_files + +echo -e "\nBackup finished\n" +# Long listing of files in $BACKUP_PATH to check file sizes. +ls -lh $BACKUP_PATH/$archive_file \ No newline at end of file From 1b2c0c34bbdb71e7726408777acb052c36391ec5 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 17:11:44 -0700 Subject: [PATCH 02/14] Update backup-bap --- backup-bap | 1 + 1 file changed, 1 insertion(+) diff --git a/backup-bap b/backup-bap index e8e5d73..8fc31dd 100644 --- a/backup-bap +++ b/backup-bap @@ -16,6 +16,7 @@ backup_files="${HOME}/pi-build \ ${HOME}/.config \ ${HOME}/.fl* \ ${HOME}/.xastir \ +${HOME}/.tqsl \ ${HOME}/.wine/drive_c/VARA/VARA.ini \ ${HOME}/Desktop \ ${HOME}/qsstv \ From e401b268261ffbcdd7dbe8c083486b478a9b8d5c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 17:20:18 -0700 Subject: [PATCH 03/14] Update backup-bap --- backup-bap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backup-bap b/backup-bap index 8fc31dd..9ad7ff6 100644 --- a/backup-bap +++ b/backup-bap @@ -1,5 +1,5 @@ #!/bin/bash -echo -e "BAP Backup utility \n" +echo -e "\nBAP Backup utility \n" # Where to backup BACKUP_PATH="/tmp" MOUNT_POINT="/media/usb" @@ -20,6 +20,9 @@ ${HOME}/.tqsl \ ${HOME}/.wine/drive_c/VARA/VARA.ini \ ${HOME}/Desktop \ ${HOME}/qsstv \ +${HOME}/.local/share/WSJT-X \ +${HOME}/.local/share/JS8Call \ +${HOME}/.local/share/pat \ ${HOME}/.conkyrc \ ${HOME}/*.*" From 528a35e147999a4cd58f933cafa78aed7de6885c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 17:21:12 -0700 Subject: [PATCH 04/14] Update backup-bap --- backup-bap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup-bap b/backup-bap index 9ad7ff6..d7a701e 100644 --- a/backup-bap +++ b/backup-bap @@ -40,4 +40,5 @@ tar czf $BACKUP_PATH/$archive_file $backup_files echo -e "\nBackup finished\n" # Long listing of files in $BACKUP_PATH to check file sizes. -ls -lh $BACKUP_PATH/$archive_file \ No newline at end of file +ls -lh $BACKUP_PATH/$archive_file +#EOF From 77c22ae2ce1d551c3c7937a931a5dde4c118928c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 17:44:08 -0700 Subject: [PATCH 05/14] Update backup-bap --- backup-bap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backup-bap b/backup-bap index d7a701e..584ee7b 100644 --- a/backup-bap +++ b/backup-bap @@ -31,6 +31,11 @@ day=$(date +%A) hostname=$(hostname -s) archive_file="BAP-Backup-$hostname-$day.tgz" +#make some extra backup notes abnout the repo we have currently +echo -e "\n\nBAP Backup Log for $($BACKUP_PATH/$archive_file)" +echo -e "$(cd pi-build/ && git branch)\n" >> ${HOME}/BAP-backup-log.txt +echo -e "$(git show --pretty=medium | head -7)\n" >> >> ${HOME}/BAP-backup-log.txt + # Print start status message. echo -e "\nBacking up $backup_files to $BACKUP_PATH/$archive_file \n\n" date From d8fcf5adb45c9c456c521c725787429b391ad20e Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 17:47:01 -0700 Subject: [PATCH 06/14] Update backup-bap --- backup-bap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backup-bap b/backup-bap index 584ee7b..d715de2 100644 --- a/backup-bap +++ b/backup-bap @@ -32,9 +32,9 @@ hostname=$(hostname -s) archive_file="BAP-Backup-$hostname-$day.tgz" #make some extra backup notes abnout the repo we have currently -echo -e "\n\nBAP Backup Log for $($BACKUP_PATH/$archive_file)" -echo -e "$(cd pi-build/ && git branch)\n" >> ${HOME}/BAP-backup-log.txt -echo -e "$(git show --pretty=medium | head -7)\n" >> >> ${HOME}/BAP-backup-log.txt +echo -e "\n\nBAP Backup Log for $($BACKUP_PATH/$archive_file)" >> ${HOME}/BAP-backup-log.txt +echo -e "$(git show --pretty=medium | head -7)\n" >> ${HOME}/BAP-backup-log.txt +echo -e "$(cd pi-build/ && git branch)\n\n" >> ${HOME}/BAP-backup-log.txt # Print start status message. echo -e "\nBacking up $backup_files to $BACKUP_PATH/$archive_file \n\n" From fca9ba6b8fda17cc07f646407886baa5406a7384 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 18:22:13 -0700 Subject: [PATCH 07/14] Update backup-bap --- backup-bap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup-bap b/backup-bap index d715de2..dc608a5 100644 --- a/backup-bap +++ b/backup-bap @@ -20,6 +20,7 @@ ${HOME}/.tqsl \ ${HOME}/.wine/drive_c/VARA/VARA.ini \ ${HOME}/Desktop \ ${HOME}/qsstv \ +${HOME}/patmenu2/config \ ${HOME}/.local/share/WSJT-X \ ${HOME}/.local/share/JS8Call \ ${HOME}/.local/share/pat \ @@ -34,7 +35,7 @@ archive_file="BAP-Backup-$hostname-$day.tgz" #make some extra backup notes abnout the repo we have currently echo -e "\n\nBAP Backup Log for $($BACKUP_PATH/$archive_file)" >> ${HOME}/BAP-backup-log.txt echo -e "$(git show --pretty=medium | head -7)\n" >> ${HOME}/BAP-backup-log.txt -echo -e "$(cd pi-build/ && git branch)\n\n" >> ${HOME}/BAP-backup-log.txt +echo -e "$(cd pi-build/ && git branch)\n" >> ${HOME}/BAP-backup-log.txt # Print start status message. echo -e "\nBacking up $backup_files to $BACKUP_PATH/$archive_file \n\n" From ddf5b06b1d6b6b3cfba0585c2de730bd6ca5c8c3 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 18:25:10 -0700 Subject: [PATCH 08/14] Update backup-bap --- backup-bap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup-bap b/backup-bap index dc608a5..09870ce 100644 --- a/backup-bap +++ b/backup-bap @@ -11,7 +11,7 @@ else echo "USB here do the work" fi -# What to backup. remember the \ for new line continuation last tine has none +# What to backup. remember the \ for new line continuation last line has none backup_files="${HOME}/pi-build \ ${HOME}/.config \ ${HOME}/.fl* \ From 217eef1f33c5168aa37e1036b519107b3b225a03 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 18:32:16 -0700 Subject: [PATCH 09/14] Update backup-bap --- backup-bap | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/backup-bap b/backup-bap index 09870ce..a27b270 100644 --- a/backup-bap +++ b/backup-bap @@ -4,13 +4,6 @@ echo -e "\nBAP Backup utility \n" BACKUP_PATH="/tmp" MOUNT_POINT="/media/usb" -#check if mount point exists -if [ ! -d “MOUNT_POINT” ] ; then - echo "USB not found" -else - echo "USB here do the work" -fi - # What to backup. remember the \ for new line continuation last line has none backup_files="${HOME}/pi-build \ ${HOME}/.config \ @@ -47,4 +40,17 @@ tar czf $BACKUP_PATH/$archive_file $backup_files echo -e "\nBackup finished\n" # Long listing of files in $BACKUP_PATH to check file sizes. ls -lh $BACKUP_PATH/$archive_file + +#handle archive or off pi copy + +#scp $BACKUP_PATH/$archive_file username@to_host:/remote/directory/ + +#check if mount point exists +if [ ! -d “MOUNT_POINT” ] ; then + echo "USB not found cant copy file off SD-CARD" +else + echo "USB found" + #cp $BACKUP_PATH/$archive_file $MOUNT_POINT + +fi #EOF From ccd4dc43824eec9d5ed6a5136f05e6da0daf191d Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 18:32:59 -0700 Subject: [PATCH 10/14] Update backup-bap --- backup-bap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup-bap b/backup-bap index a27b270..e694d56 100644 --- a/backup-bap +++ b/backup-bap @@ -50,7 +50,7 @@ if [ ! -d “MOUNT_POINT” ] ; then echo "USB not found cant copy file off SD-CARD" else echo "USB found" - #cp $BACKUP_PATH/$archive_file $MOUNT_POINT + cp $BACKUP_PATH/$archive_file $MOUNT_POINT fi #EOF From 4f32864791f3daa009d5f84c5dc66f70e5bdef1c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 18:33:57 -0700 Subject: [PATCH 11/14] Update backup-bap --- backup-bap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-bap b/backup-bap index e694d56..fc30301 100644 --- a/backup-bap +++ b/backup-bap @@ -47,9 +47,9 @@ ls -lh $BACKUP_PATH/$archive_file #check if mount point exists if [ ! -d “MOUNT_POINT” ] ; then - echo "USB not found cant copy file off SD-CARD" + echo -e "\nUSB not found cant copy file off SD-CARD" else - echo "USB found" + echo -e "\nUSB found" cp $BACKUP_PATH/$archive_file $MOUNT_POINT fi From 40026471f77ef95b01fc6c370900c18e47b86a35 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 18:35:16 -0700 Subject: [PATCH 12/14] Update backup-bap --- backup-bap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-bap b/backup-bap index fc30301..cc93dbf 100644 --- a/backup-bap +++ b/backup-bap @@ -43,11 +43,11 @@ ls -lh $BACKUP_PATH/$archive_file #handle archive or off pi copy -#scp $BACKUP_PATH/$archive_file username@to_host:/remote/directory/ - #check if mount point exists if [ ! -d “MOUNT_POINT” ] ; then echo -e "\nUSB not found cant copy file off SD-CARD" + echo -e "\nOptional edit backup-bap script to scp off" + #scp $BACKUP_PATH/$archive_file username@to_host:/remote/directory/ else echo -e "\nUSB found" cp $BACKUP_PATH/$archive_file $MOUNT_POINT From 4eb12ebc10d98e447f6f67c26918d9e7269cd837 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Oct 2022 23:45:48 -0700 Subject: [PATCH 13/14] Update backup-bap --- backup-bap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backup-bap b/backup-bap index cc93dbf..db59e8f 100644 --- a/backup-bap +++ b/backup-bap @@ -47,10 +47,13 @@ ls -lh $BACKUP_PATH/$archive_file if [ ! -d “MOUNT_POINT” ] ; then echo -e "\nUSB not found cant copy file off SD-CARD" echo -e "\nOptional edit backup-bap script to scp off" + exit 1 #scp $BACKUP_PATH/$archive_file username@to_host:/remote/directory/ else echo -e "\nUSB found" cp $BACKUP_PATH/$archive_file $MOUNT_POINT fi -#EOF + +exit 0 + From e50bc7131480d08d456ff0cc40cac014781a9c24 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 4 Nov 2022 00:38:46 -0700 Subject: [PATCH 14/14] fix a typo --- backup-bap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup-bap b/backup-bap index db59e8f..b66f5eb 100644 --- a/backup-bap +++ b/backup-bap @@ -28,7 +28,7 @@ archive_file="BAP-Backup-$hostname-$day.tgz" #make some extra backup notes abnout the repo we have currently echo -e "\n\nBAP Backup Log for $($BACKUP_PATH/$archive_file)" >> ${HOME}/BAP-backup-log.txt echo -e "$(git show --pretty=medium | head -7)\n" >> ${HOME}/BAP-backup-log.txt -echo -e "$(cd pi-build/ && git branch)\n" >> ${HOME}/BAP-backup-log.txt +echo -e "$(git branch)\n" >> ${HOME}/BAP-backup-log.txt # Print start status message. echo -e "\nBacking up $backup_files to $BACKUP_PATH/$archive_file \n\n"