From fc7b2694c873908b6e0e180912a909139ba3c765 Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Wed, 13 Mar 2024 16:00:01 -0700 Subject: [PATCH] added new external backup app and update other apps --- README.md | 6 + .../External Backup Source Files/Intro.md | 23 ++ .../Sovran_SystemsOS_External_Backup.sh | 53 ++++ .../Sovran_SystemsOS_External_Backup_Icon.svg | 238 ++++++++++++++++++ .../localscript_to_remote_external_backup.sh | 5 + .../Sovran_SystemsOS_External_Backup.desktop | 7 + ...ovran_systemsOS_external_backup_install.sh | 31 +++ .../Update_Sovran_SystemsOS_Light.sh | 9 +- .../Update_Sovran_SystemsOS.sh | 13 +- 9 files changed, 380 insertions(+), 5 deletions(-) create mode 100755 Sovran_SystemsOS_External_Backup/External Backup Source Files/Intro.md create mode 100755 Sovran_SystemsOS_External_Backup/External Backup Source Files/Sovran_SystemsOS_External_Backup.sh create mode 100755 Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/Icon_External_Backup/Sovran_SystemsOS_External_Backup_Icon.svg create mode 100755 Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/localscript_to_remote_external_backup.sh create mode 100755 Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/Sovran_SystemsOS_External_Backup.desktop create mode 100755 Sovran_SystemsOS_External_Backup/sovran_systemsOS_external_backup_local_installer/sovran_systemsOS_external_backup_install.sh diff --git a/README.md b/README.md index 818ab79..f9817a2 100755 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ ### +![Sovran_SystemsOS_External_Backup](https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_External_Backup/To%20Install%20on%20local%20Sovran%20Pros/.Sovran_Systems/Icon_External_Backup/Sovran_SystemsOS_External_Backup_Icon.svg) + +**The Sovran_SystemsOS_External_Backup app allows the user to back up all the Sovran Pro's important files to an external hard drive** + +### + ![Sovran_SystemsOS_Light_Updater](https://git.sovransystems.com/Sovran_Systems/Packages/raw/branch/main/Sovran_SystemsOS_Updater/To%20Install%20on%20Local%20Sovarn%20Pros/.Sovran_Systems/Icon/Sovran_SystemsOS_Updater_Iconv3.svg) **Sovran_SystemsOS_Light_Updater is the one click update app to keep your Sovran Book Pro's software up to date.** diff --git a/Sovran_SystemsOS_External_Backup/External Backup Source Files/Intro.md b/Sovran_SystemsOS_External_Backup/External Backup Source Files/Intro.md new file mode 100755 index 0000000..c43f36c --- /dev/null +++ b/Sovran_SystemsOS_External_Backup/External Backup Source Files/Intro.md @@ -0,0 +1,23 @@ + +Welcome to the Sovran_SystemsOS External Backup App! + +1. Make sure your external hard drive is plugged into your Sovran Pro in one of the open USB ports +2. The external hard drive should be at least 500GB in size +3. The external hard drive needs to be "exFAT" formatted + +This external backup app will run through a few stages. At the beginning, it will ask you to choose where to put the backup file on the attached external hard drive. Click the external hard drive from the file window and/or a folder of your liking inside the attached external hard drive to proceed. + +It could take up to 4 hours for it to finish depending on the amount of data stored on your Sovran Pro and the speed of your external hard drive. Be patient... + +When it is finished, a final pop up will state "All Finished! Please eject the drive before removing it from your Sovran Pro." + +All updates come from these links: + +https://git.sovransystems.com/Sovran_Systems/Software + +Don't Trust, Verify! + +After you have checked that the software is safe from the links above, then click "OK." + + +Enjoy! \ No newline at end of file diff --git a/Sovran_SystemsOS_External_Backup/External Backup Source Files/Sovran_SystemsOS_External_Backup.sh b/Sovran_SystemsOS_External_Backup/External Backup Source Files/Sovran_SystemsOS_External_Backup.sh new file mode 100755 index 0000000..4e1a542 --- /dev/null +++ b/Sovran_SystemsOS_External_Backup/External Backup Source Files/Sovran_SystemsOS_External_Backup.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +CHOOSE () { + +file=$(zenity --file-selection --directory --title="Sovran_SystemsOS External Backup - CHOOSE BACKUP LOCATION") + +} + +SAGE () { + +time_stamp=$(date +%Y-%m-%d-%T) + +if ! ssh root@localhost rsync -ar /run/media/Second_Drive/BTCEcoandBackup/NixOS_Snapshot_Backup/hourly.0 /"$file"/"$time_stamp"; then + + zenity --error \ + --width=700 \ + --title="Sovran_SystemsOS External Backup" \ + --text="Error Could Not Backup." + +else + + zenity --info \ + --ellipsize \ + --no-wrap \ + --width=700 \ + --title="Sovran_SystemsOS External Backup" \ + --text="All Finished! Please eject the external drive before removing it from your Sovran Pro." + +fi + +} + +######### + +curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_External_Backup/External%20Backup Source%20Files/Intro.md" | + +zenity --text-info \ +--width=1000 \ +--height=750 \ +--title="Sovran_SystemsOS External Backup" + +if [[ $? -eq 1 ]]; then + + exit 1 + +else + +CHOOSE + +SAGE | zenity --progress --no-cancel --auto-close --width=660 --pulsate --text="Backing up now. It could take up to 4 hours for it to finish depending on the amount of data stored on your Sovran Pro and the speed of your external hard drive. Be patient..." --title="Sovran_SystemsOS External Backup" + +fi +exit 0 diff --git a/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/Icon_External_Backup/Sovran_SystemsOS_External_Backup_Icon.svg b/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/Icon_External_Backup/Sovran_SystemsOS_External_Backup_Icon.svg new file mode 100755 index 0000000..3f20a06 --- /dev/null +++ b/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/Icon_External_Backup/Sovran_SystemsOS_External_Backup_Icon.svg @@ -0,0 +1,238 @@ + + + + + diff --git a/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/localscript_to_remote_external_backup.sh b/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/localscript_to_remote_external_backup.sh new file mode 100755 index 0000000..7786c35 --- /dev/null +++ b/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/localscript_to_remote_external_backup.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +bash -c "$(curl https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_External_Backup/External%20Backup%20Source%20Files/Sovran_SystemsOS_External_Backup.sh)" + +exit \ No newline at end of file diff --git a/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/Sovran_SystemsOS_External_Backup.desktop b/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/Sovran_SystemsOS_External_Backup.desktop new file mode 100755 index 0000000..b171083 --- /dev/null +++ b/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/Sovran_SystemsOS_External_Backup.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=Sovran_SystemsOS_Light Updater +Exec=/home/free/.Sovran_Systems/localscript_to_remote_external_backup.sh +Icon=/home/free/.Sovran_Systems/Icon_External_Backup/Sovran_SystemsOS_External_Backup_Icon.svg \ No newline at end of file diff --git a/Sovran_SystemsOS_External_Backup/sovran_systemsOS_external_backup_local_installer/sovran_systemsOS_external_backup_install.sh b/Sovran_SystemsOS_External_Backup/sovran_systemsOS_external_backup_local_installer/sovran_systemsOS_external_backup_install.sh new file mode 100755 index 0000000..2c033bd --- /dev/null +++ b/Sovran_SystemsOS_External_Backup/sovran_systemsOS_external_backup_local_installer/sovran_systemsOS_external_backup_install.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +pushd /home/free/Downloads + + wget https://git.sovransystems.com/Sovran_Systems/Software/archive/main.zip + + unzip main.zip + +popd + +mkdir -p /home/free/.Sovran_Systems + +mkdir -p /home/free/.local/share/applications/ + +mv "/home/free/Downloads/software/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/localscript_to_remote_external_backup.sh" /home/free/.Sovran_Systems/ + +mv "/home/free/Downloads/software/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/.Sovran_Systems/Icon_External_Backup" /home/free/.Sovran_Systems/ + +mv "/home/free/Downloads/software/Sovran_SystemsOS_External_Backup/To Install on Local Sovran Pros/Sovran_SystemsOS_External_Backup.desktop" /home/free/.local/share/applications/ + +chown free:users /home/free -R + +chmod 770 /home/free -R + +rm -rf /home/free/Downloads/software + +rm -rf /home/free/Downloads/main.zip + +rm -rf /home/free/Downloads/sovran_systemsOS_external_backup_install.sh + +exit \ No newline at end of file diff --git a/Sovran_SystemsOS_Light_Updater/Updater Source Files/Update_Sovran_SystemsOS_Light.sh b/Sovran_SystemsOS_Light_Updater/Updater Source Files/Update_Sovran_SystemsOS_Light.sh index cfe9afc..b224e31 100755 --- a/Sovran_SystemsOS_Light_Updater/Updater Source Files/Update_Sovran_SystemsOS_Light.sh +++ b/Sovran_SystemsOS_Light_Updater/Updater Source Files/Update_Sovran_SystemsOS_Light.sh @@ -14,7 +14,14 @@ fi } SPICE () { -if ! xterm -T "Sovran_SystemsOS_Light Updater" -fa 'Noto Mono' -fs 15 -fg white -bg black -e bash -c "ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure'" ; then + +time_stamp=$(date +%Y-%m-%d-%T) + +mkdir -p /home/free/Documents/Updater_App_Logs + +find /home/free/Documents/Updater_App_Logs -name "*.txt" -type f -mtime +5 -delete + +if ! ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch &> /home/free/Documents/Updater_App_Logs/'$time_stamp'_Updater_Log.txt' ; then zenity --error \ --width=500 \ diff --git a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh index 6a29ee9..afd3d81 100755 --- a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh +++ b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh @@ -14,15 +14,20 @@ fi } SPICE () { -if ! xterm -T "Sovran_SystemsOS Updater" -fa 'Noto Mono' -fs 15 -fg white -bg black -e bash -c "ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure'" ; then + +time_stamp=$(date +%Y-%m-%d-%T) + +mkdir -p /home/free/Documents/Updater_App_Logs + +find /home/free/Documents/Updater_App_Logs -name "*.txt" -type f -mtime +5 -delete + +if ! ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure &> /home/free/Documents/Updater_App_Logs/'$time_stamp'_Updater_Log.txt' ; then zenity --error \ --width=400 \ --title="Sovran_SystemsOS Updater" \ --text="Could not complete the Sovran_SystemsOS update." - exit 1 - else zenity --info \ @@ -57,4 +62,4 @@ else fi -exit 0 \ No newline at end of file +exit 0