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
- description of the function
- argument type and description
- use cases
functions
cronpi has following functions.
- deploy_daily
- deploy_monthly
- deploy_yearly
- deploy_minutely
- deploy_by_weekday
- 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
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
cronpi-1.0.0-py3-none-any.whl
(9.5 kB
view hashes)