scheduler deamon.
start a daemon process to run a task periodically.
conf/schd.yaml
jobs:
ls:
class: CommandJob
cron: "* * * * *" # run command each minute.
cmd: "ls -l"
start a daemon
schd -c conf/schd.yaml
default
conf/schd.yaml
scheduler_cls: LocalScheduler
schedule by RemoteScheduler (schd-server)
conf/schd.yaml
scheduler_cls: RemoteScheduler
scheduler_remote_host: http://localhost:8899/
worker_name: local
Send email notification when job run failed.
In schd.yaml
email:
smtp_server: smtp.gmail.com
smtp_user: yourname@gmail.com
smtp_password: xxx
from_addr: yourname@gmail.com
to_addr: yourname@gmail.com
smtp_port: 587
smtp_starttls: trueOr use environments instead.
environments:
export SCHD_SMTP_USER='yourname@gmail.com'
export SCHD_SMTP_PASS='xxx'
export SCHD_SMTP_SERVER='smtp.gmail.com'
export SCHD_SMTP_FROM="yourname@gmail.com"
export SCHD_SMTP_TO="yourname@gmail.com"
export SCHD_SMTP_PORT=25
export SCHD_SMTP_TLS=false