Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #221 from foxmask/foxmask-patch-4
Browse files Browse the repository at this point in the history
Create crontab.rst
  • Loading branch information
foxmask committed Oct 9, 2017
2 parents d0a50fe + 38ef827 commit 4f5dfd1
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/crontab.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Crontab:
========

a crontab is a system that automate tasks for you, at a given moment.

Here are the tasks to be used to run the **Trigger Happy** engine automatically


.. code-block:: bash
# trigger happy
20,40 * * * * . /home/trigger-happy/bin/recycle
10,25,41,55 * * * * . /home/trigger-happy/bin/read
*/15 * * * * . /home/trigger-happy/bin/publish
The first line is used to recycle the data, that have not been published, for example, because of reaching a rate limit.
When this behavior occurs, the data stay in the cache, to be used at the next loop

content of the **recycle** command

.. code-block:: bash
. /home/trigger-happy/bin/activate && cd /home/trigger-happy/th/ && python manage.py recycle
content of the **read** command

.. code-block:: bash
. /home/trigger-happy/bin/activate && cd /home/trigger-happy/th/ && python manage.py read
content of the **publish** command

.. code-block:: bash
. /home/trigger-happy/bin/activate && cd /home/trigger-happy/th/ && python manage.py publish
You may notice the folder `/home/trigger-happy/th/` in each command, this is a virtualenv given for the example

the periodicity of the execution, is set like this, to avoid to make 2 tasks run in same time, and also, to avoid to reach often the rate limitation of Twitter and others sensitives services

0 comments on commit 4f5dfd1

Please sign in to comment.