From 960917cdb0b23163029dc81e52f295e3281492e1 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 25 Aug 2010 11:38:10 -0500 Subject: Fix a few issues with update-web-db Signed-off-by: Dan McGee --- cron-jobs/update-web-db | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cron-jobs') diff --git a/cron-jobs/update-web-db b/cron-jobs/update-web-db index 8631a04..4d1519c 100755 --- a/cron-jobs/update-web-db +++ b/cron-jobs/update-web-db @@ -25,7 +25,6 @@ echo "$cmd: Updating DB at $(date)" >> "${LOGOUT}" cd $SPATH for arch in ${ARCHES}; do for repo in ${REPOS}; do - echo "Updating ${repo}-${arch}" case "$cmd" in update-web-db) dbfile="/srv/ftp/${repo}/os/${arch}/${repo}.db.tar.gz" @@ -34,14 +33,17 @@ for arch in ${ARCHES}; do dbfile="/srv/ftp/${repo}/os/${arch}/${repo}.files.tar.gz" flags="--filesonly" ;; esac - ./manage.py reporead ${flags} ${arch} ${dbfile} - echo "" + if [[ -f $dbfile ]]; then + echo "Updating ${repo}-${arch}" + ./manage.py reporead ${flags} ${arch} ${dbfile} + echo "" + fi done -done >> "${LOGOUT}" 2>&1 +done >> "${LOGOUT}" 2>&1 echo "" >> "${LOGOUT}" # rotate the file if it is getting big (> 10M), overwriting any old backup -if [[ $(stat -c%s update-web-db) -gt 10485760 ]]; then +if [[ $(stat -c%s "${LOGOUT}") -gt 10485760 ]]; then mv "${LOGOUT}" "${LOGOUT}.old" fi -- cgit v1.2.3-24-g4f1b