fix backups

This commit is contained in:
Heavybullets8 2022-07-26 18:28:23 -06:00
parent 939ce2f731
commit 46184a7722
2 changed files with 5 additions and 3 deletions

View File

@ -34,6 +34,7 @@ menu(){
! [[ $number_of_backups =~ ^[0-9]+$ ]] && echo -e "Error: -b needs to be assigned an interger\n\"""$number_of_backups""\" is not an interger" >&2 && exit ! [[ $number_of_backups =~ ^[0-9]+$ ]] && echo -e "Error: -b needs to be assigned an interger\n\"""$number_of_backups""\" is not an interger" >&2 && exit
[[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit [[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit
echo "Generating backup, please be patient for output.." echo "Generating backup, please be patient for output.."
menu_backup="true"
backup "$number_of_backups" backup "$number_of_backups"
;; ;;
5) 5)

View File

@ -56,6 +56,7 @@ do
exit exit
;; ;;
b) b)
backup="true"
number_of_backups=$OPTARG number_of_backups=$OPTARG
! [[ $OPTARG =~ ^[0-9]+$ ]] && echo -e "Error: -b needs to be assigned an interger\n\"""$number_of_backups""\" is not an interger" >&2 && exit ! [[ $OPTARG =~ ^[0-9]+$ ]] && echo -e "Error: -b needs to be assigned an interger\n\"""$number_of_backups""\" is not an interger" >&2 && exit
[[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit [[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit
@ -138,7 +139,7 @@ done
[[ "$dns" == "true" ]] && dns && exit [[ "$dns" == "true" ]] && dns && exit
[[ "$restore" == "true" ]] && restore && exit [[ "$restore" == "true" ]] && restore && exit
[[ "$mount" == "true" ]] && mount && exit [[ "$mount" == "true" ]] && mount && exit
if [[ "$number_of_backups" -ge 1 && "$sync" == "true" ]]; then # Run backup and sync at the same time if [[ "$backup" == "true" && "$sync" == "true" ]]; then # Run backup and sync at the same time
echo "Running the following two tasks at the same time" echo "Running the following two tasks at the same time"
echo "------------------------------------------------" echo "------------------------------------------------"
echo -e "Backing up ix-applications dataset\nSyncing catalog(s)" echo -e "Backing up ix-applications dataset\nSyncing catalog(s)"
@ -147,7 +148,7 @@ if [[ "$number_of_backups" -ge 1 && "$sync" == "true" ]]; then # Run backup and
sync & sync &
wait wait
fi fi
[[ "$number_of_backups" -ge 1 && -z "$sync" ]] && echo "Backing up \"ix-applications\" dataset, please wait.." && backup [[ "$backup" == "true" && -z "$sync" ]] && echo "Backing up \"ix-applications\" dataset, please wait.." && backup
[[ "$sync" == "true" && "$number_of_backups" -lt 1 ]] && echo "Syncing catalogs, this takes a LONG time, please wait.." && sync [[ "$sync" == "true" && -z "$backup" ]] && echo "Syncing catalogs, this takes a LONG time, please wait.." && sync
[[ "$update_all_apps" == "true" || "$update_apps" == "true" ]] && commander [[ "$update_all_apps" == "true" || "$update_apps" == "true" ]] && commander
[[ "$prune" == "true" ]] && prune [[ "$prune" == "true" ]] && prune