From 92077580d8271c8e2e090874289a8298ccb307f5 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sun, 5 Nov 2006 23:35:03 +0000 Subject: [PATCH] o don't reference the log file in the crontab but place it in the script so that when you run it by hand the last run is always logged. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@471571 13f79535-47bb-0310-9956-ffa450edef68 --- maven-meeper/src/bin/crontab.txt | 2 +- maven-meeper/src/bin/synchronize.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/maven-meeper/src/bin/crontab.txt b/maven-meeper/src/bin/crontab.txt index ed9890973..f07de1c4a 100644 --- a/maven-meeper/src/bin/crontab.txt +++ b/maven-meeper/src/bin/crontab.txt @@ -1 +1 @@ -0 */4 * * * cd ~/components/maven-meeper/src/bin; ./synchronize.sh 2>&1 | tee $HOME/repository-staging/to-ibiblio/reports/sync/last-sync-results.txt +0 */4 * * * cd ~/components/maven-meeper/src/bin; ./synchronize.sh diff --git a/maven-meeper/src/bin/synchronize.sh b/maven-meeper/src/bin/synchronize.sh index bc2011c3b..69776b564 100755 --- a/maven-meeper/src/bin/synchronize.sh +++ b/maven-meeper/src/bin/synchronize.sh @@ -13,8 +13,10 @@ dir=`pwd` syncProperties=$dir/synchronize.properties MODE=$1 - PID=$$ + +( + RUNNING=`ps -ef | grep synchronize.sh | grep -v 'sh -c' | grep -v grep | grep -v $PID` if [ ! -z "$RUNNING" ]; then echo Sync already running... exiting @@ -116,3 +118,5 @@ echo "Copying rewrite rules into place" cp $M1_M2_REWRITE_RULES $MAVEN1_REPO/.htaccess scp $M1_M2_REWRITE_RULES maven@login.ibiblio.org:/public/html/maven/.htaccess + +) > $HOME/repository-staging/to-ibiblio/reports/sync/last-sync-results.txt 2>&1