-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ImUrX-more-scheduled-jobs'
- Loading branch information
Showing
9 changed files
with
132 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOTENV_PATH=/etc/opt/pontoon.env | ||
export LANG=c | ||
|
||
cd /opt/pontoon/current | ||
source __env__/bin/activate | ||
|
||
python manage.py clear_old_sync_logs | ||
|
||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOTENV_PATH=/etc/opt/pontoon.env | ||
export LANG=c | ||
|
||
cd /opt/pontoon/current | ||
source __env__/bin/activate | ||
|
||
python manage.py clearsessions | ||
|
||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOTENV_PATH=/etc/opt/pontoon.env | ||
export LANG=c | ||
|
||
cd /opt/pontoon/current | ||
source __env__/bin/activate | ||
|
||
python manage.py collect_insights | ||
|
||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOTENV_PATH=/etc/opt/pontoon.env | ||
export LANG=c | ||
|
||
cd /opt/pontoon/current | ||
source __env__/bin/activate | ||
|
||
python manage.py send_deadline_notifications | ||
|
||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOTENV_PATH=/etc/opt/pontoon.env | ||
export LANG=c | ||
|
||
cd /opt/pontoon/current | ||
source __env__/bin/activate | ||
|
||
python manage.py send_review_notifications | ||
|
||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOTENV_PATH=/etc/opt/pontoon.env | ||
export LANG=c | ||
|
||
cd /opt/pontoon/current | ||
source __env__/bin/activate | ||
|
||
python manage.py send_suggestion_notifications | ||
|
||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOTENV_PATH=/etc/opt/pontoon.env | ||
export LANG=c | ||
|
||
cd /opt/pontoon/current | ||
source __env__/bin/activate | ||
|
||
python manage.py warmup_cache | ||
|
||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,62 @@ | ||
Automatic Synchronization (cron) | ||
-------------------------------- | ||
Scheduled Tasks (cron) | ||
====================== | ||
|
||
To enable automatic synchronization, we will use cron. | ||
Tu automatically run scheduled tasks we will use cron. | ||
|
||
To configure this, first, login as ``pontoon``:: | ||
To configure them, first, login as ``pontoon``:: | ||
|
||
su pontoon | ||
|
||
then edit the cron configuration using the following command:: | ||
|
||
crontab -e | ||
|
||
You just have to call the `debian/sync-projects.sh | ||
Once done, you can leave from the ``pontoon`` shell using the ``exit`` command. | ||
|
||
|
||
Automatic Synchronization | ||
------------------------- | ||
|
||
To enable automatic synchronization you just have to call the `debian/sync-projects.sh | ||
<https://github.com/wanadev/pontoon-debian/blob/master/debian/sync-projects.sh>`__ | ||
script at the desired interval. For example, you can add the following line to | ||
run the synchronization every hour:: | ||
script at the desired interval. | ||
|
||
For example, you can add the following line to run the synchronization every | ||
hour:: | ||
|
||
0 * * * * /opt/pontoon/current/debian/sync-projects.sh | ||
|
||
For more information, read `the crontab documentation | ||
<https://www.man7.org/linux/man-pages/man5/crontab.5.html>`__. | ||
|
||
Once done, you can leave from the ``pontoon`` shell using the ``exit`` command. | ||
|
||
.. NOTE:: | ||
|
||
If you installed Pontoon in at a custom location or if your *virtualenv* is | ||
not named ``__env__``, you will have to modify the `debian/sync-project.sh | ||
<https://github.com/wanadev/pontoon-debian/blob/master/debian/sync-projects.sh>`_ | ||
script. | ||
|
||
|
||
Other scheduled tasks | ||
--------------------- | ||
|
||
You can also fetch other tasks mentioned on the `Pontoon documentation | ||
<https://mozilla-pontoon.readthedocs.io/en/latest/admin/deployment.html#scheduled-jobs>`__. | ||
A script is provided for each tasks: | ||
|
||
* ``debian/clear-old-sync-logs.sh`` | ||
* ``debian/clear-sessions.sh`` | ||
* ``debian/collect-insights.sh`` | ||
* ``debian/send-deadline-notifications.sh`` | ||
* ``debian/send-review-notifications.sh`` | ||
* ``debian/send-suggestion-notifications.sh`` | ||
* ``debian/warmup-cache.sh`` | ||
|
||
For example, to have insights be fetched at the start of each day:: | ||
|
||
0 6 * * * /opt/pontoon/current/debian/collect-insights.sh | ||
|
||
.. NOTE:: | ||
|
||
If you installed Pontoon in at a custom location or if your *virtualenv* is | ||
not named ``__env__``, you will have to modify the scripts! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Requirements | ||
------------ | ||
============ | ||
|
||
To install Pontoon, you will need: | ||
|
||
|