diff --git a/bin/daily b/bin/daily new file mode 100644 index 000000000..3119ac162 --- /dev/null +++ b/bin/daily @@ -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 + diff --git a/bin/hourly b/bin/hourly new file mode 100644 index 000000000..4e50a6c0c --- /dev/null +++ b/bin/hourly @@ -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 diff --git a/etc/cron.d/datatracker b/etc/cron.d/datatracker new file mode 100644 index 000000000..d24117a31 --- /dev/null +++ b/etc/cron.d/datatracker @@ -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 + +