crontab-win
A simple cron-like task scheduler for Windows.
This tool allows you to schedule tasks using a crontab.txt file, similar to how cron works on Unix-like systems.
For background on the project read this blogpost about it
Installation
Install this tool using pip:
pip install crontab-win
Usage
This package provides two commands: crontab and ctab. Both can be used interchangeably.
Running the Scheduler
To start the scheduler, simply run:
crontab
or
ctab
This will start the scheduler in the foreground. It will read your crontab file and execute tasks as per the schedule. You should keep this window minimized.
By default, the scheduler looks for a file named crontab.txt in your user's home directory (e.g., C:\Users\YourUser\crontab.txt).
You can specify a different crontab file using the -c or --crontab-file option:
crontab -c "C:\path\to\my\custom_crontab.txt"
Editing the Crontab File
To open your crontab file for editing, use the show command:
crontab show
or
ctab show
This will open crontab.txt in your default text editor. If the file doesn't exist, it will be created with a helpful guide.
Crontab Syntax
Each line in the crontab file represents a single task. The syntax is as follows:
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
│ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
│ │ │ │ │
│ │ │ │ │
* * * * * command to execute
You can use * for any value, or provide specific numbers. Ranges (2-5) and lists (2,5) are also supported.
Special Nicknames
For convenience, you can use the following special nicknames instead of the five-field time specification:
| Nickname | Equivalent | Description |
|---|---|---|
@hourly |
0 * * * * |
Run once an hour at the beginning of the hour. |
@daily |
0 0 * * * |
Run once a day at midnight. |
@midnight |
0 0 * * * |
(Same as @daily) |
@weekly |
0 0 * * 0 |
Run once a week on Sunday midnight. |
@monthly |
0 0 1 * * |
Run once a month on the 1st, at midnight. |
@yearly |
0 0 1 1 * |
Run once a year on Jan 1st, at midnight. |
@annually |
0 0 1 1 * |
(Same as @yearly) |
Examples
Here are some example crontab entries:
# Run a script every 15 minutes
*/15 * * * * python C:\Users\MyUser\scripts\my_script.py
# Run a backup at 5 a.m. every day
0 5 * * * tar -zcf /var/backups/home.tgz /home/
# Use a special nickname to run a task hourly
@hourly echo "This runs every hour" >> C:\temp\hourly.log
# Run a task on the first day of every month
0 0 1 * * echo "Monthly report generation"
# Run a task every Monday at 8:00 AM
0 8 * * MON python C:\path\to\your\script.py
Start Crontab at Startup
To run the crontab scheduler automatically when Windows starts, you can create a simple batch file.
-
Create a new file named
crontab_startup.bat. -
Add the following content to the file:
@echo off start /min ctab
-
Place this batch file in your startup folder. You can open the startup folder by pressing
Win + R, typingshell:startup, and pressing Enter.
Development
To contribute to this tool, first check out 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
Metadata
Release files for crontab-win 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| crontab_win-0.2.1.tar.gz | 13.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crontab_win-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.1 kB
Release files / crontab_win-0.2.1.tar.gz
| Download URL | crontab_win-0.2.1.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a82af6fc5675e6b45d9ce2a486b6f22548fade3a10cbe1994e27d48549f6568e
|
|
BLAKE2b-256 checksum How to use checksums |
75d962e8f82bb5346b788dd92bcab322f2192b2c5f7a9fa5e049e6c5158162b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / crontab_win-0.2.1-py3-none-any.whl
| Download URL | crontab_win-0.2.1-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32a0050ed96ead054b6870a49292e6f24fc69543a74fd0ef8280e58024034a21
|
|
BLAKE2b-256 checksum How to use checksums |
eb5a528ca51a4bee4014618574e9bdb41573996bb5d6ca8d0351296167c1f63c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logSecurity for crontab-win 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for crontab_win-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.