Skip to main content

A simple command to install a cron table.

Project description

Latest PyPI version travis

A simple command to install a cron table, and make it evolve over time.

cron_install-logo.svg

Use it in a deployement task to deploy a file containing your crontab.

Usage

Call the command using the module name.

Indicate a marker, unique on the host, with -m option, that will help identify the start / end of your specific tasks in crontab.

Indicate a file containing your crontab. The file may reference environment variables, that will be replaced at installation time using the python builtin template module.

For example, if we have a file crontab.tpl containing:

MAILTO="$ADMIN_MAIL"
# recompute the model
0 0 * * * python -m project.rebuild_model >>/dev/null
# check stuff in $STUFF_DIRNAME
*/10 * * * /usr/local/bin/check_stuff $STUFF_DIRNAME >>/dev/null

Launching:

$ ADMIN_MAIL="admin@acme.info" STUFF_DIRNAME="/srv/stuff" python3 -m cron_install -m MY_PROJECT crontab.tpl

Will install the following table:

$ crontab -l
# START MY_PROJECT
MAILTO="admin@acme.info"
# recompute the model
0 0 * * * python -m project.rebuild_model >>/dev/null
# check stuff in /srv/stuff
*/10 * * * /usr/local/bin/check_stuff /srv/stuff >>/dev/null
# END MY_PROJECT

On a new run, all the part between # START MY_PROJECT and # END MY_PROJECT, will be replaced by the new crontab.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cron-install, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size cron-install-0.1.0.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page