~yerinalexey/pcrond

ref: 1b59c270999bfd2785c78de3f20c024cb8ac689f pcrond/README.rst -rw-r--r-- 1.5 KiB
1b59c270 — Luca Vercelli run test 2 years 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
58
59
60
python crond
============
.. image:: https://api.travis-ci.org/luca-vercelli/pcrond.svg?branch=master
        :target: https://travis-ci.org/luca-vercelli/pcrond

.. image:: https://coveralls.io/repos/github/luca-vercelli/pcrond/badge.svg?branch=master
        :target: https://coveralls.io/github/luca-vercelli/pcrond?branch=master

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.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