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
This commit is contained in:
Henrik Levkowetz 2016-04-08 17:21:50 +00:00
parent d96f0fe964
commit aab0a565d3
3 changed files with 109 additions and 0 deletions

27
bin/daily Normal file
View file

@ -0,0 +1,27 @@
#!/bin/bash
# Nightly datatracker jobs
DTDIR=/a/www/ietf-datatracker/web
cd $DTDIR/
# Set up the virtual environment
source $DTDIR/bin/activate
# Run the hourly jobs first
$DTDIR/bin/hourly
# Populate the yang repositories
$DTDIR/ietf/manage.py populate_yang_model_dirs
# Expire internet drafts
$DTDIR/ietf/bin/expire-ids
# Expire last calls
$DTDIR/ietf/bin/expire-last-calls
# Run an extended version of the rfc editor update, to catch changes
# with backdated timestamps
$DTDIR/ietf/bin/rfc-editor-index-updates -d 1969-01-01

65
bin/hourly Normal file
View file

@ -0,0 +1,65 @@
#!/bin/bash
# Hourly datatracker jobs
#
# This script is expected to be triggered by cron from
# $DTDIR/etc/cron.d/datatracker which should be symlinked from
# /etc/cron.d/
DTDIR=/a/www/ietf-datatracker/web
cd $DTDIR/
# Set up the virtual environment
source $DTDIR/bin/activate
# Update community lists. Remove once the community rewrite (will be around 6.20.0 )
$DTDIR/ietf/manage.py update_community_lists
# Polling backup for iana and rfc-editory post APIs
$DTDIR/ietf/bin/iana-changes-updates
$DTDIR/ietf/bin/iana-protocols-updates
$DTDIR/ietf/bin/rfc-editor-index-updates
$DTDIR/ietf/bin/rfc-editor-queue-updates
# Generate alias and virtual files for draft email aliases
$DTDIR/ietf/bin/generate-draft-aliases && \
( cd /a/postfix; /usr/sbin/postalias -o draft-aliases; ) && \
( cd /a/postfix; /usr/sbin/postmap -o draft-virtual; )
# Generate alias and virtual files for group email aliases
$DTDIR/ietf/bin/generate-wg-aliases && \
( cd /a/postfix; /usr/sbin/postalias -o group-aliases; ) && \
( cd /a/postfix; /usr/sbin/postmap -o group-virtual; )
# Generate some static files
ID=/a/www/ietf-ftp/internet-drafts/
DOWNLOAD=/a/www/www6s/download/
export TMPDIR=/a/tmp
TMPFILE1=`mktemp` || exit 1
TMPFILE2=`mktemp` || exit 1
TMPFILE3=`mktemp` || exit 1
TMPFILE4=`mktemp` || exit 1
TMPFILE5=`mktemp` || exit 1
TMPFILE6=`mktemp` || exit 1
TMPFILE7=`mktemp` || exit 1
chmod a+r $TMPFILE1 $TMPFILE2 $TMPFILE3 $TMPFILE4 $TMPFILE5 $TMPFILE6 $TMPFILE7
python -m ietf.idindex.generate_all_id_txt >> $TMPFILE1
python -m ietf.idindex.generate_id_index_txt >> $TMPFILE2
python -m ietf.idindex.generate_id_abstracts_txt >> $TMPFILE3
cp $TMPFILE1 $TMPFILE4
cp $TMPFILE2 $TMPFILE5
cp $TMPFILE3 $TMPFILE6
python -m ietf.idindex.generate_all_id2_txt >> $TMPFILE7
mv $TMPFILE1 $ID/all_id.txt
mv $TMPFILE2 $ID/1id-index.txt
mv $TMPFILE3 $ID/1id-abstracts.txt
mv $TMPFILE4 $DOWNLOAD/id-all.txt
mv $TMPFILE5 $DOWNLOAD/id-index.txt
mv $TMPFILE6 $DOWNLOAD/id-abstract.txt
mv $TMPFILE7 $ID/all_id2.txt
exit 0

17
etc/cron.d/datatracker Normal file
View file

@ -0,0 +1,17 @@
# -*- indent-with-tabs: 0 -*-
#
# Update the local copies of the IETF rfc and draft repositories
#
# Every hour
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DTDIR=/a/www/ietf-datatracker/web
# m h dom mon dow user command
05 00 * * * root $DTDIR/bin/daily
05 1-23 * * * root $DTDIR/bin/hourly