Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d14c99e
delete old files scheduler job
mishaschwartz Mar 18, 2025
8a590a5
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz Mar 20, 2025
354e74c
make every job a separate file
mishaschwartz Mar 20, 2025
2d198e8
update docs, fix alpine version, fix command executable
mishaschwartz Mar 20, 2025
84b0ef6
cleanup old code and comments
mishaschwartz Mar 20, 2025
796766e
update CHANGES
mishaschwartz Mar 20, 2025
d39494c
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz Mar 25, 2025
1059ffe
reconfigure warnings if dependent components are not enabled
mishaschwartz Mar 26, 2025
6b5483e
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz Mar 26, 2025
fa3e1c2
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz Mar 27, 2025
f0192f4
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz Mar 31, 2025
fe202df
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz Apr 4, 2025
4eff78d
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz May 1, 2025
26e0595
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz May 2, 2025
7585d55
Merge branch configurable-crontab' into delete-old-files
mishaschwartz May 8, 2025
03d5963
Merge branch 'configurable-crontab' into delete-old-files
mishaschwartz May 13, 2025
90bd59f
Merge branch 'master' into delete-old-files
mishaschwartz May 27, 2025
279b841
Merge branch 'master' into delete-old-files
mishaschwartz Aug 27, 2025
f36262f
review comments
mishaschwartz Sep 12, 2025
af633e4
Merge branch 'master' into delete-old-files
mishaschwartz Sep 12, 2025
2e4dd81
Merge branch 'master' into delete-old-files
mishaschwartz Sep 26, 2025
e61d833
Merge branch 'master' into delete-old-files
mishaschwartz Jan 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@
- Answer: This is a hack that would work based on the specific way that the docker-crontab image sets schedules.
However, this is not obvious to the user and is unreliable since it is not documented.

- Introduce a scheduler job to delete old files that may accumulate over time

Creates the `optional-component-clean_old_files` job that deletes old THREDDS log files and WPS output files.
Allows individual cleanup jobs to be enabled for each of `raven`, `finch`, `hummingbird`, and `thredds` components.
Allows the user to configure how old a file must be before it is deleted (age in days) and how to calculate the age
of the file (time since last modified, time since last accessed, time since created).

(see `env.local.example` or the `scheduler` documentation for details).

[2.10.1](https://github.com/bird-house/birdhouse-deploy/tree/2.10.1) (2025-03-10)
------------------------------------------------------------------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions birdhouse/birdhouse-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ VARS='
$BIRDHOUSE_LOCAL_ENV
$BIRDHOUSE_LOG_DIR
$COMPOSE_DIR
$COMPOSE_PROJECT_NAME
'

# list of vars to be substituted in template but they do not have to be set in env.local
Expand Down
9 changes: 9 additions & 0 deletions birdhouse/components/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ component directory to the ``BIRDHOUSE_EXTRA_CONF_DIRS`` variable in your local

* component location: ``optional-components/scheduler-job-deploy_raven_testdata``

* Automatically remove old files

* Removes files generated by other components that may accumulate over time and are not manage automatically by those components.

* Currently supports removing WPS output files from the ``finch``, ``raven``, and ``hummingbird`` components as well as log files
from the ``thredds`` component.

* component location: ``optional-components/scheduler-job-clean_old_files``

For additional configuration options for all these jobs see the ``env.local.example`` file
as well as the individual ``default.env`` files in each of the component directories.

Expand Down
4 changes: 4 additions & 0 deletions birdhouse/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export BIRDHOUSE_LOG_DIR=/var/log/birdhouse
# Must use single-quote for delayed eval.
export BIRDHOUSE_FQDN_PUBLIC='${BIRDHOUSE_FQDN}'

# Ensure that the compose project name is set as a variable so that other scripts can refer
# to it easily
export COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME:-birdhouse}"

# Append to DELAYED_EVAL list.
export DELAYED_EVAL="
$DELAYED_EVAL
Expand Down
41 changes: 41 additions & 0 deletions birdhouse/env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,47 @@ export GEOSERVER_ADMIN_PASSWORD="${__DEFAULT__GEOSERVER_ADMIN_PASSWORD}"
# (note: if using 'BIRDHOUSE_DATA_PERSIST_ROOT', it must be defined earlier, either in this file or from 'default.env')
#export BIRDHOUSE_LOGROTATE_DATA_DIR='${BIRDHOUSE_DATA_PERSIST_ROOT}/logrotate'

# These variables configure the scheduler-job-clean_old_files component
#
# For all options below:
# - variables that end with SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED will enable the a clean_old_files job for the relevant component if set to 'true'
# - variables that end with DELETE_FILES_OLDER_THAN_DAYS set a number of days. Files older than this number of days will be deleted every time
# the scheduler-job-clean_old_files scheduler job runs.
# - variables that end with DELETE_FILES_TIME_MODE is used by the find command to calculate the age of a file:
# - atime: delete files that haven't been accessed in X days
# - mtime: delete files that haven't been modified in X days
# - ctime: delete files that were created more than X days ago
# - variables that end with SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY set the frequency at which the relevant clean old files job should be run. This
# value is a string that conforms to the cron schedule format.
#
# Delete old WPS output files generated by the finch WPS component
#export FINCH_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
#export FINCH_WPS_OUTPUTS_DELETE_FILES_TIME_MODE=atime
#export FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="5 4 * * 0" # weekly on Sunday at 4:05
#export FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false
#
# Delete old WPS output files generated by the hummingbird WPS component
#export HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
#export HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_TIME_MODE=atime
#export HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="10 4 * * 0" # weekly on Sunday at 4:10
#export HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false
#
# Delete old WPS output files generated by the raven WPS component
#export RAVEN_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
#export RAVEN_WPS_OUTPUTS_DELETE_FILES_TIME_MODE=atime
#export RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="10 4 * * 0" # weekly on Sunday at 4:10
#export RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false
#
# Delete old log files generated by the thredds component
#export THREDDS_LOGS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
#export THREDDS_LOGS_DELETE_FILES_TIME_MODE=mtime
#export THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="20 4 * * 0" # weekly on Sunday at 4:20
#export THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false

#############################################################
# Proxy variables
#############################################################

# Content of "location /" in file config/proxy/conf.d/all-services.include.template
# Useful to have a custom homepage.
# Default:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# this file intentionally contains no content and is mounted to the scheduler directory if a clean_old_files job is not enabled.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

################################################################
# Example call to delete all files in /tmp last modified longer
# than 20 days ago
#
# $ sh clean-old-files.sh 20 mtime /tmp
##################################################################

AGE="$1"
MODE="$2"
LOCATION="$3"

ACCEPTABLE_MODES='|mtime|ctime|atime|'

if ! echo "$AGE" | grep -q '^[0-9][0-9]*$'; then
>&2 echo "AGE argument set to '${AGE}'. It must be an unsigned integer"
exit 1
fi

if [ "${ACCEPTABLE_MODES#*"|${MODE}|"}" = "${ACCEPTABLE_MODES}" ]; then
>&2 echo "MODE argument set to '${MODE}'. It must be one of 'mtime', 'ctime', or 'atime'"
exit 1
fi

if [ -z "${LOCATION}" ]; then
>&2 echo "LOCATION argument is blank or unset. It must refer to a path on disk."
exit 1
fi

echo "Removing files in ${LOCATION} that have a ${MODE} value greater than ${AGE} days"
find "${LOCATION}" -type f "-${MODE}" +"${AGE}" -print -delete
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: clean_old_files_finch
comment: clean old WPS output files generated by Finch
schedule: '${FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY}'
command: 'sh /clean-old-files.sh "${FINCH_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS}" "${FINCH_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}" /wps_outputs/finch'
dockerargs: >-
--rm --name scheduler-job-clean_old_files_finch
--volume ${COMPOSE_DIR}/optional-components/scheduler-job-clean_old_files/clean-old-files.sh:/clean-old-files.sh:ro
--volume "${COMPOSE_PROJECT_NAME}_wps_outputs:/wps_outputs:rw"
image: '${SCHEDULER_JOB_CLEAN_OLD_FILES_IMAGE}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given it's an unattended cron job, where is this logging to so we can debug if something goes wrong? Can log to BIRDHOUSE_LOG_DIR with already built-in logrotation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have a question about that....

Now that we are making more use of the scheduler to run additional jobs, why are we writing additional logs to BIRDHOUSE_LOG_DIR for the scheduler jobs instead of the usual pattern of logging to the stdout/stderr of the scheduler container? Then docker would manage the logs for us (and the logs can easily be backed up using the backup scheduler job).

Copy link
Collaborator

@tlvu tlvu Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging to the stdout/stderr of the scheduler container?

That is fine for regular service container (1 service, 1 container) but here if all the jobs all log to the same scheduler container we can have interleaving log if jobs runtime happen to overlap. Even without overlap, it will make searching for the desired log harder because all the jobs logs to the same place. With each separate job logging to separate file, we avoid the search for the desired job log problem and the possible overlap problem. The more jobs we have, the more likely the problems will happen.

So I much prefer each job to its own separate log file.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
scheduler:
volumes:
- ./optional-components/scheduler-job-clean_old_files/${__SCHEDULER_JOB_CLEAN_OLD_FILES_FINCH_CONFIG_LOC:-blank.config.yml}:/scheduler-job-configs/clean_old_files_finch.yml:ro}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: clean_old_files_hummingbird
comment: clean old WPS output files generated by Hummingbird
schedule: '${HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY}'
command: 'sh /clean-old-files.sh "${HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS}" "${HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}" /wps_outputs/hummingbird'
dockerargs: >-
--rm --name scheduler-job-clean_old_files_hummingbird
--volume ${COMPOSE_DIR}/optional-components/scheduler-job-clean_old_files/clean-old-files.sh:/clean-old-files.sh:ro
--volume "${COMPOSE_PROJECT_NAME}_wps_outputs:/wps_outputs:rw"
image: '${SCHEDULER_JOB_CLEAN_OLD_FILES_IMAGE}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
scheduler:
volumes:
- ./optional-components/scheduler-job-clean_old_files/${__SCHEDULER_JOB_CLEAN_OLD_FILES_HUMMINGBIRD_CONFIG_LOC:-blank.config.yml}:/scheduler-job-configs/clean_old_files_hummingbird.yml:ro}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: clean_old_files_raven
comment: clean old WPS output files generated by Raven
schedule: '${RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY}'
command: 'sh /clean-old-files.sh "${RAVEN_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS}" "${RAVEN_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}" /wps_outputs/raven'
dockerargs: >-
--rm --name scheduler-job-clean_old_files_raven
--volume ${COMPOSE_DIR}/optional-components/scheduler-job-clean_old_files/clean-old-files.sh:/clean-old-files.sh:ro
--volume "${COMPOSE_PROJECT_NAME}_wps_outputs:/wps_outputs:rw"
image: '${SCHEDULER_JOB_CLEAN_OLD_FILES_IMAGE}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
scheduler:
volumes:
- ./optional-components/scheduler-job-clean_old_files/${__SCHEDULER_JOB_CLEAN_OLD_FILES_RAVEN_CONFIG_LOC:-blank.config.yml}:/scheduler-job-configs/clean_old_files_raven.yml:ro}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: clean_old_files_thredds
comment: clean old log files generated by Thredds
schedule: '${THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY}'
command: 'sh /clean-old-files.sh "${THREDDS_LOGS_DELETE_FILES_OLDER_THAN_DAYS}" "${THREDDS_LOGS_DELETE_FILES_TIME_MODE}" /thredds'
dockerargs: >-
--rm --name scheduler-job-clean_old_files_thredds
--volume ${COMPOSE_DIR}/optional-components/scheduler-job-clean_old_files/clean-old-files.sh:/clean-old-files.sh:ro
--volume "thredds_persistence:/thredds:rw"
image: '${SCHEDULER_JOB_CLEAN_OLD_FILES_IMAGE}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
scheduler:
volumes:
- ./optional-components/scheduler-job-clean_old_files/${__SCHEDULER_JOB_CLEAN_OLD_FILES_THREDDS_CONFIG_LOC:-blank.config.yml}:/scheduler-job-configs/clean_old_files_thredds.yml:ro}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export SCHEDULER_JOB_CLEAN_OLD_FILES_DOCKER=alpine # alpine contains find with -ctime -mtime and -atime options (busybox based containers do not)
export SCHEDULER_JOB_CLEAN_OLD_FILES_VERSION=3.21
export SCHEDULER_JOB_CLEAN_OLD_FILES_IMAGE='${SCHEDULER_JOB_CLEAN_OLD_FILES_DOCKER}:${SCHEDULER_JOB_CLEAN_OLD_FILES_VERSION}'

if echo "${BIRDHOUSE_EXTRA_CONF_DIRS}" | grep -qv 'scheduler[[:space:]]*$'; then
export FINCH_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
export FINCH_WPS_OUTPUTS_DELETE_FILES_TIME_MODE=atime
export FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="5 4 * * 0" # weekly on Sunday at 4:05
export FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false
export __SCHEDULER_JOB_CLEAN_OLD_FILES_FINCH_CONFIG_LOC='$( [ "${FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "config/finch/config.yml" )'

export HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
export HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_TIME_MODE=atime
export HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="10 4 * * 0" # weekly on Sunday at 4:10
export HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false
export __SCHEDULER_JOB_CLEAN_OLD_FILES_HUMMINGBIRD_CONFIG_LOC='$( [ "${HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "config/hummingbird/config.yml" )'

export RAVEN_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
export RAVEN_WPS_OUTPUTS_DELETE_FILES_TIME_MODE=atime
export RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="15 4 * * 0" # weekly on Sunday at 4:15
export RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false
export __SCHEDULER_JOB_CLEAN_OLD_FILES_RAVEN_CONFIG_LOC='$( [ "${RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "config/raven/config.yml" )'

export THREDDS_LOGS_DELETE_FILES_OLDER_THAN_DAYS= # unset by default if this job is enabled this must be set to an integer
export THREDDS_LOGS_DELETE_FILES_TIME_MODE=mtime
export THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY="20 4 * * 0" # weekly on Sunday at 4:20
export THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED=false
export __SCHEDULER_JOB_CLEAN_OLD_FILES_THREDDS_CONFIG_LOC='$( [ "${THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "config/thredds/config.yml" )'
fi

export DELAYED_EVAL="
$DELAYED_EVAL
SCHEDULER_JOB_CLEAN_OLD_FILES_IMAGE
__SCHEDULER_JOB_CLEAN_OLD_FILES_FINCH_CONFIG_LOC
__SCHEDULER_JOB_CLEAN_OLD_FILES_HUMMINGBIRD_CONFIG_LOC
__SCHEDULER_JOB_CLEAN_OLD_FILES_RAVEN_CONFIG_LOC
__SCHEDULER_JOB_CLEAN_OLD_FILES_THREDDS_CONFIG_LOC
"

OPTIONAL_VARS="
$OPTIONAL_VARS
\$FINCH_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS
\$FINCH_WPS_OUTPUTS_DELETE_FILES_TIME_MODE
\$FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY
\$HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS
\$HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_TIME_MODE
\$HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY
\$RAVEN_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS
\$RAVEN_WPS_OUTPUTS_DELETE_FILES_TIME_MODE
\$RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY
\$THREDDS_LOGS_DELETE_FILES_OLDER_THAN_DAYS
\$THREDDS_LOGS_DELETE_FILES_TIME_MODE
\$THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_FREQUENCY
"

VARS="
$VARS
\$SCHEDULER_JOB_CLEAN_OLD_FILES_IMAGE
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
if echo "${BIRDHOUSE_EXTRA_CONF_DIRS}" | grep -qv 'scheduler[[:space:]]*$'; then
_acceptable_modes='|mtime|ctime|atime|'

if [ "${FINCH_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "${BIRDHOUSE_EXTRA_CONF_DIRS}" | grep -qv 'finch[[:space:]]*$'; then
echo "$FINCH_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS" | grep -q '^[0-9][0-9]*$' || log WARN "FINCH_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS variable must be an integer not '${FINCH_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS}'. Please set this variable to an integer or disable the finch file cleaning job. This job will not run properly!"
[ "${_acceptable_modes#*"|${FINCH_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}|"}" = "${_acceptable_modes}" ] && log WARN "FINCH_WPS_OUTPUTS_DELETE_FILES_TIME_MODE variable must be one of 'mtime', 'atime', or 'ctime' not '${FINCH_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}'. Please set this variable to a valid option or disable the finch file cleaning job. This job will not run properly!"
fi

if [ "${HUMMINGBIRD_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "${BIRDHOUSE_EXTRA_CONF_DIRS}" | grep -qv 'hummingbird[[:space:]]*$'; then
echo "$HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS" | grep -q '^[0-9][0-9]*$' || log WARN "HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS variable must be an integer not '${HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS}'. Please set this variable to an integer or disable the hummingbird file cleaning job. This job will not run properly!"
[ "${_acceptable_modes#*"|${HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}|"}" = "${_acceptable_modes}" ] && log WARN "HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_TIME_MODE variable must be one of 'mtime', 'atime', or 'ctime' not '${HUMMINGBIRD_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}'. Please set this variable to a valid option or disable the hummingbird file cleaning job. This job will not run properly!"
fi

if [ "${RAVEN_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "${BIRDHOUSE_EXTRA_CONF_DIRS}" | grep -qv 'raven[[:space:]]*$'; then
echo "$RAVEN_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS" | grep -q '^[0-9][0-9]*$' || log WARN "RAVEN_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS variable must be an integer not '${RAVEN_WPS_OUTPUTS_DELETE_FILES_OLDER_THAN_DAYS}'. Please set this variable to an integer or disable the raven file cleaning job. This job will not run properly!"
[ "${_acceptable_modes#*"|${RAVEN_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}|"}" = "${_acceptable_modes}" ] && log WARN "RAVEN_WPS_OUTPUTS_DELETE_FILES_TIME_MODE variable must be one of 'mtime', 'atime', or 'ctime' not '${RAVEN_WPS_OUTPUTS_DELETE_FILES_TIME_MODE}'. Please set this variable to a valid option or disable the raven file cleaning job. This job will not run properly!"
fi

if [ "${THREDDS_SCHEDULER_JOB_CLEAN_OLD_FILES_ENABLED}" = "true" ] && echo "${BIRDHOUSE_EXTRA_CONF_DIRS}" | grep -qv 'thredds[[:space:]]*$'; then
echo "$THREDDS_LOGS_DELETE_FILES_OLDER_THAN_DAYS" | grep -q '^[0-9][0-9]*$' || log WARN "THREDDS_LOGS_DELETE_FILES_OLDER_THAN_DAYS variable must be an integer not '${THREDDS_LOGS_DELETE_FILES_OLDER_THAN_DAYS}'. Please set this variable to an integer or disable the thredds file cleaning job. This job will not run properly!"
[ "${_acceptable_modes#*"|${THREDDS_LOGS_DELETE_FILES_TIME_MODE}|"}" = "${_acceptable_modes}" ] && log WARN "THREDDS_LOGS_DELETE_FILES_TIME_MODE variable must be one of 'mtime', 'atime', or 'ctime' not '${THREDDS_LOGS_DELETE_FILES_TIME_MODE}'. Please set this variable to a valid option or disable the thredds file cleaning job. This job will not run properly!"
fi
fi