Skip to content

Commit 445afbe

Browse files
committed
Hardcoded an rsync target path, and added a bash trap for errors in hourly and daily cron scripts.
- Legacy-Id: 17263
1 parent b5697b6 commit 445afbe

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

bin/daily

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# This script is expected to be triggered by cron from
66
# /etc/cron.d/datatracker
77

8+
# Make sure we stop if something goes wrong:
9+
trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)"; exit 1' ERR
10+
811
# Run the hourly jobs first
912
$DTDIR/bin/hourly
1013

@@ -22,8 +25,9 @@ source $DTDIR/env/bin/activate
2225
$DTDIR/ietf/manage.py update_external_command_info
2326

2427
# Get IANA-registered yang models
25-
YANG_IANA_DIR=$(python -c 'import ietf.settings; print ietf.settings.SUBMIT_YANG_IANA_MODEL_DIR')
26-
rsync -avzq --delete rsync.ietf.org::iana/yang-parameters/ ${YANG_IANA_DIR%/}/
28+
#YANG_IANA_DIR=$(python -c 'import ietf.settings; print ietf.settings.SUBMIT_YANG_IANA_MODEL_DIR')
29+
# Hardcode the rsync target to avoid any unwanted deletes:
30+
rsync -avzq --delete rsync.ietf.org::iana/yang-parameters/ /a/www/ietf-ftp/yang/ianamod/
2731

2832
# Populate the yang repositories
2933
$DTDIR/ietf/manage.py populate_yang_model_dirs -v0

bin/hourly

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# This script is expected to be triggered by cron from
66
# /etc/cron.d/datatracker
77

8+
# Make sure we stop if something goes wrong:
9+
program=${0##*/}
10+
trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)"; exit 1' ERR
11+
812
DTDIR=/a/www/ietf-datatracker/web
913
cd $DTDIR/
1014

0 commit comments

Comments
 (0)