/
crontab.ugly
56 lines (38 loc) · 2.2 KB
/
crontab.ugly
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
# crontab.ugly:
# Timed tasks for Pombola. Template file.
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# http://www.mysociety.org/
MAILTO=cron-!!(*= $site *)!!@mysociety.org
# Set the virtualenv and add it to the path so that the correct python is used -
# requires that scripts start with '#!/usr/bin/env python'
VIRTUAL_ENV="/data/vhost/!!(*= $vhost *)!!/pombola-virtualenv"
PATH=/data/vhost/!!(*= $vhost *)!!/pombola/bin/:/data/vhost/!!(*= $vhost *)!!/pombola-virtualenv/bin:/usr/local/bin:/usr/bin:/bin
# Set this PYTHONPATH so that the scripts can just 'import pombola.setup_env'
# and have everything work.
PYTHONPATH=/data/vhost/!!(*= $vhost *)!!/pombola
# Set this so that python does not choke trying to output utf8
PYTHONIOENCODING=utf-8
# check that no bad slugs have been stored in the database
0 23 * * * !!(*= $user *)!! run_management_command core_list_malformed_slugs
# Several sites use the Pombola codebase. They don't all have the same requirements
# or apps. Use the conditionals below to run the correct cron jobs, and make
# sure that they don't clash timewise.
!!(* if ($vhost eq 'mzalendo.mysociety.org') { *)!!
0 7 * * * !!(*= $user *)!! run_management_command feedback_report_pending
6 7 * * * !!(*= $user *)!! update_hansard.bash
3 10 * * * !!(*= $user *)!! run_management_command kenya_assign_aspirants_to_coalitions
# disabling the scorcard updating to remove them from the site temporarily. This
# is an interim measure, but much simpler than doing it properly by making the
# scorecard app optional, or adding some feature flip for them. See #629
# 0 1 * * * !!(*= $user *)!! run_management_command scorecard_update_person_contact_scores
!!(* } elsif ($vhost eq 'nigeria.mzalendo.mysociety.org') { *)!!
10 7 * * * !!(*= $user *)!! run_management_command feedback_report_pending
!!(* } elsif ($vhost eq 'za-pombola.staging.mysociety.org') { *)!!
# NOTE - this should probably be removed once the live site is launched
7 7 * * * !!(*= $user *)!! update_za_hansard.bash
!!(* } elsif ($vhost eq 'www.pa.org.za') { *)!!
# NOTE - until the live site is launched, crons are turned off in vhosts.pl
7 7 * * * !!(*= $user *)!! update_za_hansard.bash
!!(* } else { *)!!
!!(* } *)!!