75de6ebfe0
similar to https://github.com/linuxserver/docker-scrutiny/pull/19 fixes https://github.com/linuxserver/docker-scrutiny/issues/17 fixes https://github.com/AnalogJ/scrutiny/issues/161 fixes https://github.com/AnalogJ/scrutiny/issues/66 fixes https://github.com/AnalogJ/scrutiny/issues/202 fixes https://github.com/AnalogJ/scrutiny/issues/121
15 lines
663 B
Bash
Executable File
15 lines
663 B
Bash
Executable File
#!/bin/bash
|
|
# Cron runs in its own isolated environment (usually using only /etc/environment )
|
|
# So when the container starts up, we will do a dump of the runtime environment into a .env file that we
|
|
# will then source into the crontab file (/etc/cron.d/scrutiny.sh)
|
|
|
|
printenv | sed 's/^\(.*\)$/export \1/g' > /env.sh
|
|
|
|
# adding ability to customize the cron schedule.
|
|
SCRUTINY_COLLECTOR_CRON_SCHEDULE=${SCRUTINY_COLLECTOR_CRON_SCHEDULE:-"0 0 * * *"}
|
|
sed -i 's|{SCRUTINY_COLLECTOR_CRON_SCHEDULE}|'"${SCRUTINY_COLLECTOR_CRON_SCHEDULE}"'|g' /etc/cron.d/scrutiny
|
|
|
|
# now that we have the env start cron in the foreground
|
|
echo "starting cron"
|
|
su -c "cron -l 8 -f" root
|