4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
1 |
#!/bin/sh
|
8687.15.7
by Karl Fogel
Add the copyright header block to more files. |
2 |
#
|
3 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
|
|
4 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
|
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
5 |
|
6 |
# This script performs nightly chores. It should be run from
|
|
7 |
# cron as the launchpad user once a day. Typically the output
|
|
8 |
# will be sent to an email address for inspection.
|
|
9 |
||
4284.4.2
by Tom Haddon
Adding comment about why the http_proxy and ftp_proxy variables are needed |
10 |
# Note that http/ftp proxies are needed by the product
|
11 |
# release finder
|
|
12 |
||
7516.1.1
by Tom Haddon
Moving nightly.sh script to run on loganberry |
13 |
# Only run this script on loganberry
|
4430.1.1
by Tom Haddon
Making nightly.sh executable, changing release to cdimage on prober |
14 |
THISHOST=`uname -n` |
7516.1.1
by Tom Haddon
Moving nightly.sh script to run on loganberry |
15 |
if [ "loganberry" != "$THISHOST" ] |
4430.1.1
by Tom Haddon
Making nightly.sh executable, changing release to cdimage on prober |
16 |
then
|
7516.1.1
by Tom Haddon
Moving nightly.sh script to run on loganberry |
17 |
echo "This script must be run on loganberry." |
4430.1.1
by Tom Haddon
Making nightly.sh executable, changing release to cdimage on prober |
18 |
exit 1 |
19 |
fi
|
|
20 |
||
21 |
# Only run this as the launchpad user
|
|
22 |
USER=`whoami` |
|
23 |
if [ "launchpad" != "$USER" ] |
|
24 |
then
|
|
25 |
echo "Must be launchpad user to run this script." |
|
26 |
exit 1 |
|
27 |
fi
|
|
28 |
||
29 |
||
4759.3.1
by Tom Haddon
Mirror prober separated out from nightly.sh, some nightly.sh changes and rosetta config for forster |
30 |
export LPCONFIG=production |
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
31 |
export http_proxy=http://squid.internal:3128/ |
32 |
export ftp_proxy=http://squid.internal:3128/ |
|
33 |
||
34 |
LOCK=/var/lock/launchpad_nightly.lock |
|
35 |
lockfile -r0 -l 259200 $LOCK |
|
36 |
if [ $? -ne 0 ]; then |
|
37 |
echo Unable to grab $LOCK lock - aborting |
|
38 |
ps fuxwww |
|
39 |
exit 1 |
|
40 |
fi
|
|
41 |
||
42 |
cd /srv/launchpad.net/production/launchpad/cronscripts
|
|
43 |
||
44 |
echo == Expiring memberships `date` == |
|
6320.2.1
by Tom Haddon
Use python2.4 in nightly.sh, mirror_prober.sh and import_blacklist.py |
45 |
python2.4 flag-expired-memberships.py -q |
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
46 |
|
6623.4.16
by Tim Penhey
Add a new cronscript to be run each night, and remove the creation of the historical karma revisions when a user validates an email address. This is now handled by the cronscript. |
47 |
echo == Allocating revision karma `date` == |
48 |
python2.4 allocate-revision-karma.py -q |
|
49 |
||
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
50 |
echo == Recalculating karma `date` == |
6320.2.1
by Tom Haddon
Use python2.4 in nightly.sh, mirror_prober.sh and import_blacklist.py |
51 |
python2.4 foaf-update-karma-cache.py -q |
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
52 |
|
53 |
echo == Updating cached statistics `date` == |
|
6320.2.1
by Tom Haddon
Use python2.4 in nightly.sh, mirror_prober.sh and import_blacklist.py |
54 |
python2.4 update-stats.py -q |
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
55 |
|
56 |
echo == Expiring questions `date` == |
|
6320.2.1
by Tom Haddon
Use python2.4 in nightly.sh, mirror_prober.sh and import_blacklist.py |
57 |
python2.4 expire-questions.py |
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
58 |
|
5114.1.1
by Tom Haddon
Adding pofile stats and commenting expire-bugtasks |
59 |
### echo == Expiring bugs `date` ==
|
6320.2.1
by Tom Haddon
Use python2.4 in nightly.sh, mirror_prober.sh and import_blacklist.py |
60 |
### python2.4 expire-bugtasks.py
|
4896.2.1
by Curtis Hovey
added expire-bugtasks.py to nightly.sh |
61 |
|
6204.2.1
by Curtis Hovey
Added a test to verify the default root_path is config.error_reports.error_dir. |
62 |
# checkwatches.py is scheduled in the /code/pqm/launchpad_crontabs branch.
|
63 |
### echo == Updating bug watches `date` ==
|
|
6320.2.1
by Tom Haddon
Use python2.4 in nightly.sh, mirror_prober.sh and import_blacklist.py |
64 |
### python2.4 checkwatches.py
|
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
65 |
|
5729.5.1
by Graham Binns
Moved the run of update-bugtask-targetnamecaches to the end of nightly.sh so that it doesn't block other scripts. |
66 |
echo == Updating bugtask target name caches `date` == |
6320.2.1
by Tom Haddon
Use python2.4 in nightly.sh, mirror_prober.sh and import_blacklist.py |
67 |
python2.4 update-bugtask-targetnamecaches.py -q |
5729.5.1
by Graham Binns
Moved the run of update-bugtask-targetnamecaches to the end of nightly.sh so that it doesn't block other scripts. |
68 |
|
6376.1.2
by Barry Warsaw
updates for mthaddon |
69 |
echo == Updating personal standings `date` == |
70 |
python2.4 update-standing.py -q |
|
6376.1.1
by Barry Warsaw
run update-standing.py once nightly |
71 |
|
6722.1.1
by Bjorn Tillenius
Rearrange nightly.sh, so that scripts that talk over the network, and |
72 |
echo == Updating CVE database `date` == |
73 |
python2.4 update-cve.py -q |
|
74 |
||
75 |
echo == Updating package cache `date` == |
|
76 |
python2.4 update-pkgcache.py -q |
|
77 |
||
78 |
echo == POFile stats `date` == |
|
79 |
python2.4 rosetta-pofile-stats.py |
|
80 |
||
81 |
echo == Product Release Finder `date` == |
|
82 |
python2.4 product-release-finder.py -q |
|
83 |
||
84 |
||
4284.4.1
by Tom Haddon
Added nightly.sh to cronscripts directory |
85 |
rm -f $LOCK
|