From a94959bcf9447a5d7e7b411925737baff2aeaf91 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 24 Oct 2025 15:15:05 -0700 Subject: [PATCH] Add more verbosity. Change "BACKUP" to "DOCKER". --- tasks/general/acct_mgmt/users.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 9cfbe4c..1022837 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -805,18 +805,23 @@ } alias clean-backups="clean-backup" function_pull_prod_backups: | - export BACKUP="Backup" + export DOCKER="DOCKER" export SYSTEM="System" function pull_prod_backup { - if [[ -z "$1" || ("$1" != "$BACKUP" && "$1" != "$SYSTEM") ]]; then - echo "ERROR: Parameter 1 not correct, expecting '$BACKUP' or '$SYSTEM'." + if [[ -z "$1" || ("$1" != "$DOCKER" && "$1" != "$SYSTEM") ]]; then + echo "ERROR: Parameter 1 not correct, expecting '$DOCKER' or '$SYSTEM'." return 1 fi backup_type="$1" - if [[ -f *"${backup_type}"*".zip" ]]; then + echo "Looking for '*${backup_type}*.zip'" + ls -lh *${backup_type}*.zip 2>/dev/null + status="$?" + echo "Status of file check came back as '$status'." + if [[ "$status" == "0" ]]; then echo "File already downloaded, skipping." - ls -lh *"${backup_type}"*".zip" return 0 + else + echo "File still needed, downloading to local tmp/." fi mkdir -pv tmp scp -P {{ prod_port }} \ @@ -835,9 +840,9 @@ dir="ProductionBackups-Pulled`today`" mkdir -pv "$dir" cd "$dir" - pull_prod_backup "$BACKUP" + pull_prod_backup "$DOCKER" pull_prod_backup "$SYSTEM" - du -h *.zip + ls -lh *.zip status="$?" cd .. if [[ "$status" != 0 ]]; then