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

Create crontab.rst #221

Merged
merged 2 commits into from
Oct 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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