A user-space cron.d directory
Project description
crondir
Manage your user crontab with snippets in a cron.d directory in your home.
Simplifies the automated management of cron tasks in the user space. Snippets are concatenated from your cron.d into the crontab.
- Store and manage crontab snippets in separate files
- Does not interfere with existing crontab entries
- Backs up crontab each time it builds
- Everything configurable
Usage
A crontab snippet is a file containing lines to go in a crontab.
To install:
pip install crondir
Add a cron snippet:
crondir add path/to/snippet_name
Remove a cron snippet:
crondir remove snippet_name
List installed cron snippets:
crondir list
Build the crontab from current definitions:
crondir build
Or you may find it easier to skip the install step and run it using uv.
uvx crondir add path/to/snippet_name
uvx crondir remove path/to/snippet_name
uvx crondir list
uvx crondir build
By default, crondir stores crontab snippets in ~/.cron.d/, and creates backups
in ~/.cron.d/backups/.
For full command line options, see command documentation
Example
Lets say we're deploying a project with hourly and daily cron tasks, and will be running
it from a deploy user. Our project is at /home/deploy/project/
Create a snippet file in our project, cron_tasks, containing the lines to add to the
crontab:
0 * * * * /home/deploy/project/bin/hourly_refresh.sh
1 0 * * * /home/deploy/project/bin/daily_refresh.sh
To add this snippet, run:
cd ~
uvx crondir add project/cron_task project_tasks
uvx crondir build
This will:
- create the dir
~/.cron.d/ - copy
project/cron_taskinto~/.cron.d/as~/.cron.d/project_tasks - rebuild the crontab to include the lines from
~/.cron.d/project_tasks
If we want to remove the snippet, we can run:
cd ~
uvx crondir remove project_tasks
uvx crondir build
This will
- remove the file
~/.cron.d/project_tasks - concatenate all the files in
~/.cron.d - add them to the crontab under any existing unmanaged entries
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crondir-0.2.0.tar.gz.
File metadata
- Download URL: crondir-0.2.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed69564273ab4855d4370e161531f1bef0bde302928759d27beb76d29795652b
|
|
| MD5 |
22f1263aaa634fa30c52217f0a192b3c
|
|
| BLAKE2b-256 |
6f94bfb48806baee4f3f061362d13917443b16408aeca02876ec61213f53071f
|
Provenance
The following attestation bundles were made for crondir-0.2.0.tar.gz:
Publisher:
pypi.yml on radiac/crondir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crondir-0.2.0.tar.gz -
Subject digest:
ed69564273ab4855d4370e161531f1bef0bde302928759d27beb76d29795652b - Sigstore transparency entry: 467088362
- Sigstore integration time:
-
Permalink:
radiac/crondir@25bd2446c72ef5d5816ba20742cccadc6215de4a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/radiac
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@25bd2446c72ef5d5816ba20742cccadc6215de4a -
Trigger Event:
push
-
Statement type:
File details
Details for the file crondir-0.2.0-py3-none-any.whl.
File metadata
- Download URL: crondir-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fea11419290dd4d77e3028f8d2cecfb1e51d7edb06fe97e33a2ec3761873829
|
|
| MD5 |
9d62ce615a74fad54cb1d7d9499ebee8
|
|
| BLAKE2b-256 |
2c5a9e5cdcbf8360dcb011501a04023e3977044a393702d47c55ad1b290a22f8
|
Provenance
The following attestation bundles were made for crondir-0.2.0-py3-none-any.whl:
Publisher:
pypi.yml on radiac/crondir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crondir-0.2.0-py3-none-any.whl -
Subject digest:
3fea11419290dd4d77e3028f8d2cecfb1e51d7edb06fe97e33a2ec3761873829 - Sigstore transparency entry: 467088378
- Sigstore integration time:
-
Permalink:
radiac/crondir@25bd2446c72ef5d5816ba20742cccadc6215de4a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/radiac
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@25bd2446c72ef5d5816ba20742cccadc6215de4a -
Trigger Event:
push
-
Statement type: