Bunch of changes; renaming the ConfigBackup; you kinda suck

This commit is contained in:
2022-09-12 20:46:56 +03:00
parent 0f2a754e17
commit ea3d2b76b5
4 changed files with 31 additions and 22 deletions

View File

@@ -1,7 +1,9 @@
#!/bin/bash
##Simple script to run Restic backups
source $SCRIPTS/Okiru
source /root/.bash_profile
source /home/shmick/Scripts/Okiru
source /etc/environment
export HOME=/root/
arg0=$(basename "$0")
#Show help if arguments are misused
usage()
@@ -26,9 +28,9 @@ help()
echo " {-l|--limit} #[Kbps] -- Limit upload & download speed"
echo " {-h|--help} -- Print this help message and exit"
echo "Available repositories:"
echo "Gerbil-TK Photos (path: /Red-Vol/Media/Pictures)"
echo "Pukeko-XYZ-Containers Containers (path: /Red-Vol/Media/Containers)"
echo "Pukeko-XYZ-Cloud Data from all devices (path: /Red-Vol/Media/Cloud/Syncthing)"
echo "Gerbil-TK Photos (path: /var/Red-Vol/Media/Pictures)"
echo "Pukeko-XYZ-Containers Containers (path: /var/Red-Vol/Media/Containers)"
echo "Pukeko-XYZ-Cloud Data from all devices (path: /var/Red-Vol/Media/Cloud/Syncthing)"
exit 0
}
#Pass arguments to the script
@@ -135,22 +137,22 @@ clean(){
if [[ -n $REPOSITORY ]] && [[ -z $CLEAN ]]; then
case "$REPOSITORY" in
(Gerbil-TK)
backup Gerbil-TK /Red-Vol/Media/Pictures/
backup Gerbil-TK /var/Red-Vol/Media/Pictures/
;;
(Pukeko-XYZ-Containers)
backup Pukeko-XYZ-Containers /Red-Vol/Media/Containers
backup Pukeko-XYZ-Containers /var/Red-Vol/Media/Containers
;;
(Pukeko-XYZ-Cloud)
backup Pukeko-XYZ-Cloud /Red-Vol/Media/Cloud/Syncthing
backup Pukeko-XYZ-Cloud /var/Red-Vol/Media/Cloud/Syncthing
;;
(*)
help;;
esac
#If cleaning was not forced, backup the repositories
elif [[ -z $CLEAN ]]; then
backup Gerbil-TK /Red-Vol/Media/Pictures/
backup Pukeko-XYZ-Containers /Red-Vol/Media/Containers
backup Pukeko-XYZ-Cloud /Red-Vol/Media/Cloud/Syncthing
backup Gerbil-TK /var/Red-Vol/Media/Pictures/
backup Pukeko-XYZ-Containers /var/Red-Vol/Media/Containers
backup Pukeko-XYZ-Cloud /var/Red-Vol/Media/Cloud/Syncthing
#If a specific repository was requested to be cleaned, clean it
elif [[ -n $REPOSITORY ]] && [[ -n $CLEAN ]]; then
case "$REPOSITORY" in
@@ -174,3 +176,4 @@ elif [[ -n $CLEAN ]] || [[ $(date +%a) == "Friday" ]]; then
fi
#Wrap up this run's log and report nicely
end_logging
exit 0