remove uneeded
This commit is contained in:
parent
0884c75ec2
commit
f2d30a74e5
@ -9,7 +9,7 @@ date=$(date '+%Y_%m_%d_%H_%M_%S')
|
||||
[[ "$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 &> /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")
|
||||
if [[ ${#list_backups[@]} -gt "number_of_backups" ]]; then
|
||||
if [[ ${#list_backups[@]} -gt "$number_of_backups" ]]; then
|
||||
echo_backup+=("\nDeleted the oldest backup(s) for exceeding limit:")
|
||||
overflow=$(( ${#list_backups[@]} - "$number_of_backups" ))
|
||||
mapfile -t list_overflow < <(cli -c 'app kubernetes list_backups' | grep "HeavyScript_" | sort -t '_' -V -k2,7 | awk -F '|' '{print $2}'| tr -d " \t\r" | head -n "$overflow")
|
||||
|
@ -34,12 +34,9 @@ case $selection in
|
||||
;;
|
||||
4)
|
||||
read -rt 600 -p "Please type the max number of backups to keep: " number_of_backups
|
||||
number_of_backups=$number_of_backups
|
||||
! [[ $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
|
||||
echo "Generating backup, please be patient for output.."
|
||||
menu_backup="true"
|
||||
backup "$number_of_backups"
|
||||
;;
|
||||
5)
|
||||
restore="true"
|
||||
|
Loading…
Reference in New Issue
Block a user