summaryrefslogtreecommitdiff
path: root/cron-jobs
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-08-25 11:38:10 -0500
committerDan McGee <dan@archlinux.org>2010-08-25 11:38:10 -0500
commit960917cdb0b23163029dc81e52f295e3281492e1 (patch)
treeb94fe1b21213c8ac46d0d5ad1ea04dd7e12a9723 /cron-jobs
parent0e9dc9f69e290fe352de7b2bbd288890a78eced5 (diff)
Fix a few issues with update-web-db
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'cron-jobs')
-rwxr-xr-xcron-jobs/update-web-db12
1 files changed, 7 insertions, 5 deletions
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