diff --git a/bashup-backup-files.sh b/bashup-backup-files.sh index 3f6868c..c80718a 100755 --- a/bashup-backup-files.sh +++ b/bashup-backup-files.sh @@ -7,8 +7,7 @@ # load include file source $(dirname $0)/bashup.sh -bashup::set_existing_backups -bashup::set_retention_array +bashup::set-retention_array # create backup for today if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then diff --git a/bashup-backup-mysql.sh b/bashup-backup-mysql.sh index b1b2a67..deca41b 100755 --- a/bashup-backup-mysql.sh +++ b/bashup-backup-mysql.sh @@ -7,8 +7,7 @@ # load include file source $(dirname $0)/bashup.sh -bashup::set_existing_backups -bashup::set_retention_array +bashup::set-retention_array # create backup for today if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then diff --git a/bashup-backup-pdns.sh b/bashup-backup-pdns.sh index 211a64a..4fa575e 100755 --- a/bashup-backup-pdns.sh +++ b/bashup-backup-pdns.sh @@ -7,8 +7,7 @@ # load include file source $(dirname $0)/bashup.sh -bashup::set_existing_backups -bashup::set_retention_array +bashup::set-retention_array # create backup for today if [[ " ${retention_array[@]} " =~ " ${today} " ]]; then diff --git a/bashup-list-backups.sh b/bashup-list-backups.sh index aaa8188..09f649b 100755 --- a/bashup-list-backups.sh +++ b/bashup-list-backups.sh @@ -92,7 +92,9 @@ if [ ! -z "$backup" ]; then fi else # 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 bashup::unmount_storage_dir diff --git a/bashup.sh b/bashup.sh index d2dfa37..5e7f577 100755 --- a/bashup.sh +++ b/bashup.sh @@ -70,9 +70,9 @@ if [[ "$0" == *"-backup-"* ]];then fi fi -function bashup::set_retention_array () { +function bashup::set-retention_array () { - declare -a retention_array + declare -a -g retention_array # set retention days if [ $retention_days -gt 0 ]; then