Skip to content

Commit aab0a56

Browse files
committed
Added a crontab file to be symlinked from /etc/cron.d/, and related scripts to be run from cron. Requires refactoring of CronRunner and NightRunner scripts before activation, to avoid duplicate runs.
- Legacy-Id: 11111
1 parent d96f0fe commit aab0a56

3 files changed

Lines changed: 109 additions & 0 deletions

File tree

bin/daily

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Nightly datatracker jobs
4+
5+
DTDIR=/a/www/ietf-datatracker/web
6+
7+
cd $DTDIR/
8+
9+
# Set up the virtual environment
10+
source $DTDIR/bin/activate
11+
12+
# Run the hourly jobs first
13+
$DTDIR/bin/hourly
14+
15+
# Populate the yang repositories
16+
$DTDIR/ietf/manage.py populate_yang_model_dirs
17+
18+
# Expire internet drafts
19+
$DTDIR/ietf/bin/expire-ids
20+
21+
# Expire last calls
22+
$DTDIR/ietf/bin/expire-last-calls
23+
24+
# Run an extended version of the rfc editor update, to catch changes
25+
# with backdated timestamps
26+
$DTDIR/ietf/bin/rfc-editor-index-updates -d 1969-01-01
27+

bin/hourly

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
# Hourly datatracker jobs
4+
#
5+
# This script is expected to be triggered by cron from
6+
# $DTDIR/etc/cron.d/datatracker which should be symlinked from
7+
# /etc/cron.d/
8+
9+
DTDIR=/a/www/ietf-datatracker/web
10+
cd $DTDIR/
11+
12+
# Set up the virtual environment
13+
source $DTDIR/bin/activate
14+
15+
# Update community lists. Remove once the community rewrite (will be around 6.20.0 )
16+
$DTDIR/ietf/manage.py update_community_lists
17+
18+
# Polling backup for iana and rfc-editory post APIs
19+
$DTDIR/ietf/bin/iana-changes-updates
20+
$DTDIR/ietf/bin/iana-protocols-updates
21+
$DTDIR/ietf/bin/rfc-editor-index-updates
22+
$DTDIR/ietf/bin/rfc-editor-queue-updates
23+
24+
# Generate alias and virtual files for draft email aliases
25+
$DTDIR/ietf/bin/generate-draft-aliases && \
26+
( cd /a/postfix; /usr/sbin/postalias -o draft-aliases; ) && \
27+
( cd /a/postfix; /usr/sbin/postmap -o draft-virtual; )
28+
29+
# Generate alias and virtual files for group email aliases
30+
$DTDIR/ietf/bin/generate-wg-aliases && \
31+
( cd /a/postfix; /usr/sbin/postalias -o group-aliases; ) && \
32+
( cd /a/postfix; /usr/sbin/postmap -o group-virtual; )
33+
34+
# Generate some static files
35+
ID=/a/www/ietf-ftp/internet-drafts/
36+
DOWNLOAD=/a/www/www6s/download/
37+
38+
export TMPDIR=/a/tmp
39+
40+
TMPFILE1=`mktemp` || exit 1
41+
TMPFILE2=`mktemp` || exit 1
42+
TMPFILE3=`mktemp` || exit 1
43+
TMPFILE4=`mktemp` || exit 1
44+
TMPFILE5=`mktemp` || exit 1
45+
TMPFILE6=`mktemp` || exit 1
46+
TMPFILE7=`mktemp` || exit 1
47+
chmod a+r $TMPFILE1 $TMPFILE2 $TMPFILE3 $TMPFILE4 $TMPFILE5 $TMPFILE6 $TMPFILE7
48+
49+
python -m ietf.idindex.generate_all_id_txt >> $TMPFILE1
50+
python -m ietf.idindex.generate_id_index_txt >> $TMPFILE2
51+
python -m ietf.idindex.generate_id_abstracts_txt >> $TMPFILE3
52+
cp $TMPFILE1 $TMPFILE4
53+
cp $TMPFILE2 $TMPFILE5
54+
cp $TMPFILE3 $TMPFILE6
55+
python -m ietf.idindex.generate_all_id2_txt >> $TMPFILE7
56+
57+
mv $TMPFILE1 $ID/all_id.txt
58+
mv $TMPFILE2 $ID/1id-index.txt
59+
mv $TMPFILE3 $ID/1id-abstracts.txt
60+
mv $TMPFILE4 $DOWNLOAD/id-all.txt
61+
mv $TMPFILE5 $DOWNLOAD/id-index.txt
62+
mv $TMPFILE6 $DOWNLOAD/id-abstract.txt
63+
mv $TMPFILE7 $ID/all_id2.txt
64+
65+
exit 0

etc/cron.d/datatracker

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- indent-with-tabs: 0 -*-
2+
#
3+
# Update the local copies of the IETF rfc and draft repositories
4+
#
5+
# Every hour
6+
7+
PATH=/sbin:/usr/sbin:/bin:/usr/bin
8+
9+
DTDIR=/a/www/ietf-datatracker/web
10+
11+
# m h dom mon dow user command
12+
13+
05 00 * * * root $DTDIR/bin/daily
14+
15+
05 1-23 * * * root $DTDIR/bin/hourly
16+
17+

0 commit comments

Comments
 (0)