This commit is contained in:
Heavybullets8 2022-07-26 00:39:25 -06:00
parent 70109420c9
commit 8456f40fd2
2 changed files with 3 additions and 3 deletions

View File

@ -4,8 +4,8 @@
backup(){ backup(){
echo_backup+=("\nNumber of backups was set to $number_of_backups") echo_backup+=("\nNumber of backups was set to $number_of_backups")
date=$(date '+%Y_%m_%d_%H_%M_%S') date=$(date '+%Y_%m_%d_%H_%M_%S')
[[ "$verbose" == "true" ]] && cli -c 'app kubernetes backup_chart_releases backup_name=''"'HeavyScript_"$date"'"' [[ "$verbose" == "true" ]] && cli -c 'app kubernetes backup_chart_releases backup_name=''"'HeavyScript_"$date"'"' &> /dev/null && echo_backup+=(HeavyScript_"$date")
[[ -z "$verbose" ]] && echo_backup+=("\nNew Backup Name:") && cli -c 'app kubernetes backup_chart_releases backup_name=''"'HeavyScript_"$date"'"' | tail -n 1 [[ -z "$verbose" ]] && echo_backup+=("\nNew Backup Name:") && cli -c 'app kubernetes backup_chart_releases backup_name=''"'HeavyScript_"$date"'"' | tail -n 1 &> /dev/null && echo_backup+=(HeavyScript_"$date")
mapfile -t list_backups < <(cli -c 'app kubernetes list_backups' | grep "HeavyScript_" | sort -t '_' -Vr -k2,7 | awk -F '|' '{print $2}'| tr -d " \t\r") mapfile -t list_backups < <(cli -c 'app kubernetes list_backups' | grep "HeavyScript_" | sort -t '_' -Vr -k2,7 | awk -F '|' '{print $2}'| tr -d " \t\r")
if [[ ${#list_backups[@]} -gt "number_of_backups" ]]; then if [[ ${#list_backups[@]} -gt "number_of_backups" ]]; then
echo_backup+=("\nDeleting the oldest backup(s) for exceeding limit:") echo_backup+=("\nDeleting the oldest backup(s) for exceeding limit:")

View File

@ -137,7 +137,7 @@ done
[[ "$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 [[ "$number_of_backups" -ge 1 && "$sync" == "true" ]]; then # Run backup and sync at the same time
echo "Backing up and syncing catalogs at the same time, please wait for output.." echo -e "Backing up and syncing catalogs at the same time, please wait for output..\n"
backup & backup &
sync & sync &
wait wait