Skip to content
/ cron Public

Stateful, small-yet-robust cron - mostly meant for managing my routines by generating Taskwarrior tasks

Notifications You must be signed in to change notification settings

allgreed/cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cron

Stateful, small-yet-robust cron - mostly meant for managing my routines by generating Taskwarrior tasks. Though you can probably extend it to do pretty much everything. If you're brave enough.

I'm open sourcing it because @oneacik liked it

What's wrong with crontab or native recurring tasks?

TODO: elaborate

Features (at the time of writing)

Disclaimer: I don't intend to keep this section up to date, maybe will autogenerate in the future, whatever

The source is small enough that I recommend going through it for a comprehensive overview

  • making simple things simple

    let's say for the sake of the argument that as per Papa Peterson you'd like to clean your room every week:

    class CleanRoom(Weekly):
        task = T("clean the room!")
  • reasonable defaults

    • example: create tags are automatically tagged with +cron and until is set for their recurrence date (so a Weekly task has until:7d)
    • there are already present durations for week, month, etc.
  • escape hatch

    TODO: show shell for browser for example
  • deep Taskwarrior integration - interval rollover

    # TODO: provide code example

    TODO: explain this feature

  • making complex things possible

    # TODO: provide code example
    mkPeriodic
    + class override

Usage

git clone [email protected]:allgreed/cron.git
mkdir mycron
# or whatever you want to call it
cd $_
ln -s ../cron/cron.py cron.py
ln -s ../cron/default.nix default.nix
cat << EOF > mycron.py
from cron import main, Task as T, Weekly

# here go your Recurrings
...

if __name__ == "__main__":
    main()
EOF

write an actual Recurring and then

nix-shell
python3 mycron.py

Dev

Design principles

  1. specific purpose - my use case will Trump all other concerns
  2. straightforward - at the same time I believe that my use case is common enough that there should be something already. I couldn't find anything, so I'm doing this. This is not innovative, surprises are a bug, this is not a place of honor.
  3. optionally a bit clever - re:epistemological value of programming - while coding this I'm learning more about routines and recurrence - this leads to ideas, however they're a) optional b) specific - example: interval rollover (which needs to be explicitly enabled)

Prerequisites

Hint: if something doesn't work because of missing package please add the package to default.nix instead of installing it on your computer. Why solve the problem for one if you can solve the problem for all? ;)

One-time setup

make init

Everything

make help

About

Stateful, small-yet-robust cron - mostly meant for managing my routines by generating Taskwarrior tasks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published