diff --git a/configs/web/applications/docs-sync b/configs/web/applications/docs-sync index 5ce1850..e60057c 100644 --- a/configs/web/applications/docs-sync +++ b/configs/web/applications/docs-sync @@ -1,12 +1,50 @@ -#!/bin/sh - -TMPFILE=`mktemp -dp /var/tmp docs.XXXXXXXXXX` || exit 1 -cd $TMPFILE +#!/bin/sh +CACHEDIR='/var/cache/docsSite/' export CVSROOT=:pserver:anonymous@cvs.fedora.redhat.com:/cvs/fedora -cvs co -r LIVE web > /dev/null 2>&1 + +function cleanlock() +{ + /bin/rm -f /var/lock/$1.lock +} + + +function quit() +{ + echo $1 + if [ $2 ] + then + cleanlock $2 + fi + exit 2 +} + +function newlock() +{ + if [ -f /var/lock/$1.lock ] + then + quit "Lockfile exists.. Remove /var/lock/$1.lock" + else + touch /var/lock/$1.lock + fi +} + +newlock docSync +if [ ! -d $CACHEDIR ] +then + echo "CACHEDIR missing" + mkdir $CACHEDIR + cd $CACHEDIR + cvs co -r LIVE web > /dev/null 2>&1 +fi + + +cd $CACHEDIR + +cvs up -d LIVE web > /dev/null 2>&1 cd web sed -i s/project-web/web/g Makefile +echo starting build make tree > /dev/null 2>&1 cd fedoraweb /bin/mkdir -p /srv/web/docs/css/ @@ -19,6 +57,8 @@ cd fedoraweb # For bug #65 rm -rf /srv/web/docs/package-list/ -rm -rf $TMPFILE -/sbin/restorecon -R /srv/web +/sbin/restorecon -R /srv/web/docs/ +/sbin/restorecon -R /srv/web/rhold/ +cleanlock docSync + diff --git a/configs/web/applications/docs-sync.cron b/configs/web/applications/docs-sync.cron index 2a390ec..e0dede2 100644 --- a/configs/web/applications/docs-sync.cron +++ b/configs/web/applications/docs-sync.cron @@ -1 +1 @@ -05 12 * * * root /root/bin/docs-sync > /dev/null 2> /dev/null +05 01,07,14,21 * * * root /root/bin/docs-sync > /dev/null 2> /dev/null