bashup::set-retention_array function fixes
This commit is contained in:
parent
7f413eda04
commit
ab487bdc80
|
@ -7,8 +7,7 @@
|
||||||
# load include file
|
# load include file
|
||||||
source $(dirname $0)/bashup.sh
|
source $(dirname $0)/bashup.sh
|
||||||
|
|
||||||
bashup::set_existing_backups
|
bashup::set-retention_array
|
||||||
bashup::set_retention_array
|
|
||||||
|
|
||||||
# create backup for today
|
# create backup for today
|
||||||
if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then
|
if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
# load include file
|
# load include file
|
||||||
source $(dirname $0)/bashup.sh
|
source $(dirname $0)/bashup.sh
|
||||||
|
|
||||||
bashup::set_existing_backups
|
bashup::set-retention_array
|
||||||
bashup::set_retention_array
|
|
||||||
|
|
||||||
# create backup for today
|
# create backup for today
|
||||||
if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then
|
if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
# load include file
|
# load include file
|
||||||
source $(dirname $0)/bashup.sh
|
source $(dirname $0)/bashup.sh
|
||||||
|
|
||||||
bashup::set_existing_backups
|
bashup::set-retention_array
|
||||||
bashup::set_retention_array
|
|
||||||
|
|
||||||
# create backup for today
|
# create backup for today
|
||||||
if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then
|
if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then
|
||||||
|
|
|
@ -92,7 +92,9 @@ if [ ! -z "$backup" ]; then
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# output list of backups (dates)
|
# output list of backups (dates)
|
||||||
ls -1 $backup_storage_dir | grep -v lost+found
|
for existing_backup in "${existing_backups[@]}"; do
|
||||||
|
echo $existing_backup
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bashup::unmount_storage_dir
|
bashup::unmount_storage_dir
|
||||||
|
|
|
@ -70,9 +70,9 @@ if [[ "$0" == *"-backup-"* ]];then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function bashup::set_retention_array () {
|
function bashup::set-retention_array () {
|
||||||
|
|
||||||
declare -a retention_array
|
declare -a -g retention_array
|
||||||
|
|
||||||
# set retention days
|
# set retention days
|
||||||
if [ $retention_days -gt 0 ]; then
|
if [ $retention_days -gt 0 ]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user