~yerinalexey/pcrond

ref: fd39483ff3f6ed6c8650e873d925efe2cfbeafe6 pcrond/README.rst -rw-r--r-- 1.4 KiB
fd39483f — Luca Vercelli Merge branch 'master' of https://github.com/luca-vercelli/pcrond 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
python crond
============
.. image:: https://api.travis-ci.org/luca-vercelli/schedule.svg?branch=master
        :target: https://travis-ci.org/luca-vercelli/pcrond

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


Userspace cron daemon

A daemon similar to the standard `crond`, 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 https://github.com/dbader/schedule, release under MIT license.

This project is not interested in the "human stuff" of the original project.



Features 
--------
(well, mostly taken from https://github.com/dbader/schedule)

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

Usage
-----

.. code-block:: bash

    $ ./setup.py install --prefix=~/.local
    $ pcrond path/to/my/crontab/file
    
(this assumes that `~/.local/bin` is in the PATH)
It is also possible to use this library within youir python program, however this is not the intended use.
If you want to do this, just mimic what pcrond.py does.

.. code-block:: python

    from pcrond import scheduler
    scheduler.add_job("30 4 * * 0", my_python_func)     #every sunday at 4:30
    scheduler.main_loop()