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.

logo

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


Download files

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

Source Distribution

cron-install-0.2.0.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file cron-install-0.2.0.tar.gz.

File metadata

  • Download URL: cron-install-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for cron-install-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9f4d88dab25440b582aba6e5ec6e729efa3f7cfc6e1a9b4684d5c1dc074f8375
MD5 cb65f8bc216447ad5574cec6fd3e7e96
BLAKE2b-256 8087733bddfc19f77fe6ce70a0d8f06d0a3053408d13af9fccf7f00288fb9303

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page