summaryrefslogtreecommitdiffstats
path: root/cron-jobs/update-web-db
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-08-25 18:39:16 +0200
committerDan McGee <dan@archlinux.org>2010-08-25 18:39:16 +0200
commit1d6eb15bcc4c355edef1d6c249e9c67bca7d0404 (patch)
treec0b08f900fa1cd9bdfcf13819cd475657005a27a /cron-jobs/update-web-db
parent960917cdb0b23163029dc81e52f295e3281492e1 (diff)
downloaddbscripts-1d6eb15bcc4c355edef1d6c249e9c67bca7d0404.tar.gz
dbscripts-1d6eb15bcc4c355edef1d6c249e9c67bca7d0404.tar.xz
update-web-db: reformat to coding style
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'cron-jobs/update-web-db')
-rwxr-xr-xcron-jobs/update-web-db34
1 files changed, 18 insertions, 16 deletions
diff --git a/cron-jobs/update-web-db b/cron-jobs/update-web-db
index 4d1519c..3504813 100755
--- a/cron-jobs/update-web-db
+++ b/cron-jobs/update-web-db
@@ -15,8 +15,8 @@ LOGOUT="/tmp/archweb_update.log"
# figure out what operation to perform
cmd="$(basename $0)"
if [[ $cmd != "update-web-db" && $cmd != "update-web-files-db" ]]; then
- echo "Invalid command name '$cmd' specified!"
- exit 1
+ echo "Invalid command name '$cmd' specified!"
+ exit 1
fi
echo "$cmd: Updating DB at $(date)" >> "${LOGOUT}"
@@ -25,19 +25,19 @@ echo "$cmd: Updating DB at $(date)" >> "${LOGOUT}"
cd $SPATH
for arch in ${ARCHES}; do
for repo in ${REPOS}; do
- case "$cmd" in
- update-web-db)
- dbfile="/srv/ftp/${repo}/os/${arch}/${repo}.db.tar.gz"
- flags="" ;;
- update-web-files-db)
- dbfile="/srv/ftp/${repo}/os/${arch}/${repo}.files.tar.gz"
- flags="--filesonly" ;;
- esac
- if [[ -f $dbfile ]]; then
- echo "Updating ${repo}-${arch}"
- ./manage.py reporead ${flags} ${arch} ${dbfile}
- echo ""
- fi
+ case "$cmd" in
+ update-web-db)
+ dbfile="/srv/ftp/${repo}/os/${arch}/${repo}.db.tar.gz"
+ flags="" ;;
+ update-web-files-db)
+ dbfile="/srv/ftp/${repo}/os/${arch}/${repo}.files.tar.gz"
+ flags="--filesonly" ;;
+ esac
+ if [[ -f $dbfile ]]; then
+ echo "Updating ${repo}-${arch}"
+ ./manage.py reporead ${flags} ${arch} ${dbfile}
+ echo ""
+ fi
done
done >> "${LOGOUT}" 2>&1
@@ -45,5 +45,7 @@ echo "" >> "${LOGOUT}"
# rotate the file if it is getting big (> 10M), overwriting any old backup
if [[ $(stat -c%s "${LOGOUT}") -gt 10485760 ]]; then
- mv "${LOGOUT}" "${LOGOUT}.old"
+ mv "${LOGOUT}" "${LOGOUT}.old"
fi
+
+# vim: set ts=4 sw=4 et ft=sh: