Skip to main content

crontab for windows

Project description

crontab-win

PyPI Changelog Tests License

CRONTAB for windows.

Add crontab entries in a textfile and then this programs are executed as per schedule.

To use the crontab.txt, type crontab show or ctab show this will open the crontab.txt.

Edit this file to introduce tasks to be run by cron.

Each task to run has to be defined through a single line indicating with different fields when the task will be run and what command to run for the task

To define the time you can provide concrete values for minute (m), hour (h), day of month (dom), month (mon), and day of week (dow) or use '*' in these fields (for 'any').

Notice that tasks will be started based on the system notion of time and timezones.

Output of the crontab jobs (including errors) is shown to the user the crontab file belongs to (unless redirected).

For example, you can run a backup of all your user accounts at 5 a.m every week with:

0 5 * * 1 tar -zcf /var/backups/home.tgz /home/

Read the blogpost about it

Installation

Install this tool using pip:

pip install crontab-win

Usage

For help, run:

crontab --help

You can also use:

python -m crontab --help

crontab syntax

┌───────────── 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 execute

Start crontab at startup

create a batch file

@echo off
start /min ctab 

and keep it in shell:startup folder.

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd crontab-win
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

python -m pytest

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

crontab_win-0.0.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crontab_win-0.0.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file crontab_win-0.0.2.tar.gz.

File metadata

  • Download URL: crontab_win-0.0.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for crontab_win-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4c94c17914d82e0f1fbcb54bd9d195452da3769abf32ad8c8fba7570ca02649d
MD5 04cc98769b6399b9c722d8bf9e447144
BLAKE2b-256 13fa5a8091cefeaa38a54dd6a418fb62c9e826e124bd43167ee3b859a1abc85b

See more details on using hashes here.

Provenance

The following attestation bundles were made for crontab_win-0.0.2.tar.gz:

Publisher: publish.yml on sukhbinder/crontab-win

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crontab_win-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: crontab_win-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for crontab_win-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a0b0fb06566a45be262f6941360d6b749c457bad4d071c87fd922b898fbd120
MD5 70dcf10bb30117eeca2cb733c304fcaf
BLAKE2b-256 0c0f540bc50f927b53ff0ea4b5545e915d89f5afe43ce6be58d74afff59ca5cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for crontab_win-0.0.2-py3-none-any.whl:

Publisher: publish.yml on sukhbinder/crontab-win

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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