diff options
Diffstat (limited to 'docker/runtime')
-rw-r--r-- | docker/runtime/backup-init.sh | 4 | ||||
-rw-r--r-- | docker/runtime/backup-rotator.sh | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/docker/runtime/backup-init.sh b/docker/runtime/backup-init.sh index 07298c5d..f4e21a1b 100644 --- a/docker/runtime/backup-init.sh +++ b/docker/runtime/backup-init.sh @@ -30,7 +30,9 @@ parse_generate_cron_expression() { CRON_EXPR_DAYS="*" CRON_EXPR_MONTHS="*" + # shellcheck disable=SC2001 TIME_INTERVAL=$(echo "${BACKUP_INTERVAL}" | sed -e 's/[hdM]$//') + # shellcheck disable=SC2001 TIME_UNIT=$(echo "${BACKUP_INTERVAL}" | sed -e 's/^[0-9]\+//') if [ "${TIME_UNIT}" = "h" ]; then @@ -74,7 +76,9 @@ parse_generate_cron_expression() { parse_generate_retention_expression() { FIND_TIME_EXPR='mtime' + # shellcheck disable=SC2001 TIME_INTERVAL=$(echo "${BACKUP_RETENTION}" | sed -e 's/[mhdM]$//') + # shellcheck disable=SC2001 TIME_UNIT=$(echo "${BACKUP_RETENTION}" | sed -e 's/^[0-9]\+//') if [ "${TIME_UNIT}" = "m" ]; then diff --git a/docker/runtime/backup-rotator.sh b/docker/runtime/backup-rotator.sh index 51665f57..7e882fc0 100644 --- a/docker/runtime/backup-rotator.sh +++ b/docker/runtime/backup-rotator.sh @@ -21,7 +21,7 @@ main() { exit 1 fi - find "${BACKUP_PATH}/" -type f -name "gogs-backup-*.zip" -${FIND_EXPRESSION} -print -exec rm "{}" + + find "${BACKUP_PATH}/" -type f -name "gogs-backup-*.zip" "-${FIND_EXPRESSION}" -print -exec rm "{}" + } main "$@" |