~yerinalexey/pcrond

ref: 6a0a6eb0d6838806d06e235facc95e47ddf4a3fb pcrond/README.rst -rw-r--r-- 1.2 KiB
6a0a6eb0 — Alexey Yerin chore(readme): remove leading spaces 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
python crond
============

Userspace cron daemon

A daemon similar to the standard ``cron`` daemon [1], however it is designed to run in userspace, not as root.
Jobs scheduling use exactly the same formalism of crond.

Written in Python.

Some of the code was taken from ``schedule`` project [2].
This project is not interested in the "human stuff" of the original project.


Features
--------
(well, mostly taken from [2])

- A simple to use API for scheduling jobs.
- Very lightweight and no external dependencies.
- Good test coverage.
- Tested on Python 2.7 and 3.6

Install
-----

.. code-block:: bash

    $ ./setup.py install --prefix=~/.local

(this assumes that ``~/.local/bin`` is in the PATH, that is quite common)

Usage
-----

.. code-block:: bash

    $ pcrond.py -r path/to/my/crontab/file

It is also possible to use this library within your Python program, however this is not the intended use.
For example:

.. code-block:: python

    from pcrond import Scheduler

    scheduler = Scheduler()
    scheduler.add_job("30 4 * * 0", my_python_func)     #every sunday at 4:30
    scheduler.main_loop()


Links
-----
[1] https://en.wikipedia.org/wiki/Cron

[2] https://github.com/dbader/schedule