Removed references to Jobber, replaced with Cron. Created crontab at /etc/cron.d/scrutiny Running cron in foreground. Adding timezone support Working Collector image (untested master).pull/162/head
parent
27b923b5e9
commit
011642a708
@ -0,0 +1,6 @@
|
|||||||
|
/dist
|
||||||
|
/vendor
|
||||||
|
/.idea
|
||||||
|
/.github
|
||||||
|
/.git
|
||||||
|
/webapp/frontend/node_modules
|
@ -0,0 +1,9 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
# now that we have the env start cron in the foreground
|
||||||
|
echo "starting cron"
|
||||||
|
cron -f
|
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
if [ -n "${TZ}" ]
|
||||||
|
then
|
||||||
|
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime
|
||||||
|
echo "${TZ}" > /etc/timezone
|
||||||
|
fi
|
@ -0,0 +1,15 @@
|
|||||||
|
# Example of job definition:
|
||||||
|
# .---------------- minute (0 - 59)
|
||||||
|
# | .------------- hour (0 - 23)
|
||||||
|
# | | .---------- day of month (1 - 31)
|
||||||
|
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
|
||||||
|
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
|
||||||
|
# | | | | |
|
||||||
|
# * * * * * user-name command to be executed
|
||||||
|
|
||||||
|
# TODO: correctly route collector logs (STDOUT & STDERR), print to Cron foreground (collectable by Docker STDOUT?)
|
||||||
|
# TODO: change cron schedule to daily at midnight: '0 0 0 * * *'
|
||||||
|
# System environmental variables are stripped by cron, source our dump of the docker environmental variables before each command
|
||||||
|
* * * * * root . /env.sh; /scrutiny/bin/scrutiny-collector-metrics run >> /var/log/scrutiny.log 2>&1
|
||||||
|
* * * * * root date >> /var/log/cron.log
|
||||||
|
# An empty line is required at the end of this file for a valid cron file.
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/execlineb -S0
|
#!/usr/bin/execlineb -S0
|
||||||
|
|
||||||
echo "jobber/cron exiting"
|
echo "cron exiting"
|
||||||
s6-svscanctl -t /var/run/s6/services
|
s6-svscanctl -t /var/run/s6/services
|
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/with-contenv 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
|
||||||
|
|
||||||
|
echo "starting cron"
|
||||||
|
cron -f
|
@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
|
||||||
|
|
||||||
echo "starting jobber/cron"
|
|
||||||
|
|
||||||
su -c "/usr/lib/x86_64-linux-gnu/jobberrunner /scrutiny/jobber/jobber.yaml" root
|
|
@ -1,30 +0,0 @@
|
|||||||
version: 1.4
|
|
||||||
|
|
||||||
prefs:
|
|
||||||
logPath: /scrutiny/jobber/log.log
|
|
||||||
runLog:
|
|
||||||
type: file
|
|
||||||
path: /scrutiny/jobber/runlog
|
|
||||||
maxFileLen: 100m
|
|
||||||
maxHistories: 2
|
|
||||||
|
|
||||||
resultSinks:
|
|
||||||
- &filesystemSink
|
|
||||||
type: filesystem
|
|
||||||
path: /scrutiny/jobber
|
|
||||||
data:
|
|
||||||
- stdout
|
|
||||||
- stderr
|
|
||||||
maxAgeDays: 10
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
MetricsJob:
|
|
||||||
cmd: /scrutiny/bin/scrutiny-collector-metrics run
|
|
||||||
# run daily at midnight.
|
|
||||||
time: '0 0 0 * * *'
|
|
||||||
onError: Backoff
|
|
||||||
notifyOnSuccess:
|
|
||||||
- *filesystemSink
|
|
||||||
notifyOnFailure:
|
|
||||||
- *filesystemSink
|
|
||||||
|
|
Loading…
Reference in new issue