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.
Crontab jobs management in Python
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
Brilliant module, congrats!
It would be extra awesome if it could be combined with, for instance, @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?:
I get 500.
This should be a list not dictionary. Also removed some unnecessary white space.
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.
Minor spelling error
I've just tried to use 'update' parameter on run function and it's working as I need.
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.
Just a few minor changes to remove pep8 violations.
…ssed to Plan
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)
Plan.env, on the contrary, does work
Here is simple docker file example for some one want to use in docker, hope you like it.