diff options
author | Theo Chatzimichos <tampakrap@gentoo.org> | 2010-09-12 23:18:29 +0300 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gentoo.org> | 2010-09-12 23:18:29 +0300 |
commit | 700a153bda9138adf418ae978fc1dd449d8e11f4 (patch) | |
tree | 0d77ce8cfcec0e85f29959b2c80542809066ca49 /scripts/update-venus | |
parent | remove fauli from universe (diff) | |
download | planet-700a153bda9138adf418ae978fc1dd449d8e11f4.tar.gz planet-700a153bda9138adf418ae978fc1dd449d8e11f4.tar.bz2 planet-700a153bda9138adf418ae978fc1dd449d8e11f4.zip |
svnignore->gitignore
Add media dir with static data taken from the server
Add scripts dir with the cron job and the python scripts
Correct the templates dir
Diffstat (limited to 'scripts/update-venus')
-rw-r--r-- | scripts/update-venus | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/update-venus b/scripts/update-venus new file mode 100644 index 00000000..7c0c02e9 --- /dev/null +++ b/scripts/update-venus @@ -0,0 +1,33 @@ +#!/bin/bash +DATE=$(date +%F) +LOG_DATE=$(date +%F-%R) +BASE_DIR="/var/www/planet.gentoo.org/" +RESTRICT="" +VENUS_DIR="/usr/lib/python2.6/site-packages/venus/" + +cd ${BASE_DIR} + +# Get latest SVN changes +git pull ${BASE_DIR}/planet-gentoo/configs/ >/dev/null 2>&1 +git pull ${BASE_DIR}/planet-gentoo/templates/ >/dev/null 2>&1 + +# Run Venus +for x in planet universe; do + if [[ ! -z $RESTRICT ]]; then + for y in $RESTRICT; do + rm ${BASE_DIR}configs/${x}/${y} + done + fi + cat ${BASE_DIR}planet-gentoo/configs/base/venus.${x} ${BASE_DIR}planet-gentoo/configs/${x}/* > ${BASE_DIR}generated_configs/venus.${x}.ini + python ${VENUS_DIR}planet.py ${BASE_DIR}configs/venus.${x}.ini > ${BASE_DIR}logs/${x}/${LOG_DATE}.log 2>&1 +done + +# Delete old logs +find ${BASE_DIR}logs -type f -mtime +30 -delete + +# Archive posts +cp ${BASE_DIR}htdocs/index.html \ + ${BASE_DIR}htdocs/archives/${DATE}.html +cp ${BASE_DIR}htdocs/universe/index.html \ + ${BASE_DIR}htdocs/universe/archives/${DATE}.html + |