Skip to main content

a small crontab deploying package for python3

Project description

cronpi

A small tool for deploying crontab into a Linux System By using Python3.

Install crontabs into the system if it's not installed. This will override if the crontab with same command already exists in crontab

Install

pip install cronpi

Usage

Putting mouse over the function will show the detail information of that function. It shows

  1. description of the function
  2. argument type and description
  3. use cases

title

functions

cronpi has following functions.

  1. deploy_daily
  2. deploy_monthly
  3. deploy_yearly
  4. deploy_minutely
  5. deploy_by_weekday
  6. deploy

From 1~5 the name of the function denote what they do. 6th deploy function will deploy the command which we write while editing crontab.

cronpi.deploy("* * * * * sh /run/some/commands.sh")
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                   7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command to execut

Below are the use cases for Running job Daily

1. Run daily at 0:00

cronpi.deploy_daily("sh /some/command.sh")

2. Run daily at 5:00AM

cronpi.deploy_daily("sh /some/command.sh", 5)

3. Run daily at 5:30AM

cronpi.deploy_daily("sh /some/command.sh", 5, 30)

For others put the mouse over the function and see detail.

Note

Only support in unix-like system, eg. Linux/Mac

License

MIT

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

cronpi-1.0.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

cronpi-1.0.0-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

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