Crontab jobs management in Python

Related tags

plan
Overview
Plan

    Plan is a Python package for writing and deploying cron jobs.  Plan will 
    convert Python code to cron syntax.  You can easily manage your cron jobs
    with Plan like a charm.  It is designed for elegancy and writing cron jobs
    with as little amount of code as possible.  It's extensible but comes with
    serveral good useful job types out of the box.

    The purpose is making writing cronfile fun and without causing mistakes.

    Plan has following goods:

    -   one command to create a quickstart example schedule.py file
    -   easy to define your task, every frequency, at moment, running path,
        running bash environment, task output
    -   handle communicate with your crontab process with features like write,
        update or clear
    
    Read the docs at http://plan.readthedocs.org/

    If you feel anything wrong, feedbacks or pull requests are welcome.
Issues
  • Do not exit on success cron update

    Do not exit on success cron update

    I'm trying to use the Plan to add cron commands at Django site startup. When I use 'update' mode my Django server go down, because 'update' command send sys.exit(1) signal. I fix that by this code, but I think it's ugly:

    # Don't exit on success
    try:
        cron.run("update")
    except SystemExit:
        pass
    
    opened by inlanger 8
  • Global distributed crontab

    Global distributed crontab

    Brilliant module, congrats!

    It would be extra awesome if it could be combined with, for instance, @ansible:

    https://github.com/ansible/ansible

    Often sysadmins have several machines running cron and they forget what is running on which, causing race conditions on services that rely on different states and dependencies.

    Having both composable crontab modules and a global view of how crontabs look like across machines would be quite awesome feature.

    Have you checked Chronos, for instance?:

    http://airbnb.github.io/chronos/

    opened by brainstorm 4
  • Website down?

    Website down?

    https://pythonhosted.org/plan/

    I get 500.

    opened by microamp 4
  • Fixed PREDEFINED_DEFINITIONS list

    Fixed PREDEFINED_DEFINITIONS list

    This should be a list not dictionary. Also removed some unnecessary white space.

    opened by sandlbn 2
  • add MAILTO to cron groups

    add MAILTO to cron groups

    opened by GuoJing 2
  • Make Python 3 page more positive

    Make Python 3 page more positive

    For this project, I don't see why the Python 3 page (http://plan.readthedocs.org/python3.html) needs to recommend Python 2. It supports Python 3 and only depends on click, which also supports Python 3.

    It's also very well possible to schedule your cron using Python 3 but have the application be in Python 2 (if necessary). The far majority of packages now support Python 3 (http://python3wos.appspot.com/) so the decision should be left to the user.

    opened by svisser 2
  • Update quickstart.rst

    Update quickstart.rst

    Minor spelling error

    opened by wbashir 1
  • Check if command exists in crontab file?

    Check if command exists in crontab file?

    I've just tried to use 'update' parameter on run function and it's working as I need.

    opened by inlanger 1
  • Updated setup.py to include the supported Python versions

    Updated setup.py to include the supported Python versions

    It wasn't clear to me what Python versions were supported. This PR updates the setup.py to have the same versions as tox.ini.

    opened by svisser 1
  • Taking out pep8 violations

    Taking out pep8 violations

    Just a few minor changes to remove pep8 violations.

    opened by lowks 1
  • Fix default behaviour: use <current system user> if user param not pa…

    Fix default behaviour: use if user param not pa…

    …ssed to Plan

    opened by z00sts 0
  • fix the decode error bug if the job params has no-ascii word

    fix the decode error bug if the job params has no-ascii word

    File "/Users/chenzhang/PycharmProjects/threatbook_spider/visual_spider_web/views/slave_views.py", line 74, in make_cron_tasks cron.run('update') File "/Users/chenzhang/envs/threatbook_spider/lib/python3.6/site-packages/plan/core.py", line 278, in run self.update_crontab(run_type) File "/Users/chenzhang/envs/threatbook_spider/lib/python3.6/site-packages/plan/core.py", line 221, in update_crontab current_crontab = self.read_crontab() File "/Users/chenzhang/envs/threatbook_spider/lib/python3.6/site-packages/plan/core.py", line 202, in read_crontab r = communicate_process(command, universal_newlines=True) File "/Users/chenzhang/envs/threatbook_spider/lib/python3.6/site-packages/plan/utils.py", line 22, in communicate_process output, error = p.communicate(stdin) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 843, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1554, in _communicate self.stdout.errors) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 740, in _translate_newlines data = data.decode(encoding, errors) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 60898: ordinal not in range(128)

    opened by CheungChan 0
  • it seems that `environment` arguement does not work

    it seems that `environment` arguement does not work

    neither for Plan nor for Job Plan.env, on the contrary, does work

    opened by Casyfill 0
  • Add docker example

    Add docker example

    Here is simple docker file example for some one want to use in docker, hope you like it.

    opened by cropse 0
Python job scheduling for humans.

schedule Python job scheduling for humans. Run Python functions (or any other callable) periodically using a friendly syntax. A simple to use API for

Dan Bader 9.1k Oct 23, 2021
The easiest way to automate your data

Hello, world! ?? We've rebuilt data engineering for the data science era. Prefect is a new workflow management system, designed for modern infrastruct

Prefect 7.6k Oct 23, 2021
Python-Repeated-Timer is an open-source & highly performing timer using only standard-libraries.

Python Repeated Timer Python-Repeated-Timer is an open-source & highly performing timer using only standard-libraries.

TACKHYUN JUNG 3 Sep 8, 2021
A powerful workflow engine implemented in pure Python

Spiff Workflow Summary Spiff Workflow is a workflow engine implemented in pure Python. It is based on the excellent work of the Workflow Patterns init

Samuel 1k Oct 20, 2021
A calendaring app for Django. It is now stable, Please feel free to use it now. Active development has been taken over by bartekgorny.

Django-schedule A calendaring/scheduling application, featuring: one-time and recurring events calendar exceptions (occurrences changed or cancelled)

Tony Hauber 796 Oct 21, 2021