From 6f70763a57257ea554a107f5f7c9a08829f108f1 Mon Sep 17 00:00:00 2001 From: Louwrentius Date: Sun, 11 Jan 2009 21:57:00 +0000 Subject: [PATCH] Fixed creating of individual item log file, issue #7 thanks denk.junk.mail --- trunk/ppss.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/trunk/ppss.sh b/trunk/ppss.sh index bd56c41..56f7216 100755 --- a/trunk/ppss.sh +++ b/trunk/ppss.sh @@ -39,7 +39,7 @@ trap 'kill_process; ' INT # Setting some vars. Do not change. SCRIPT_NAME="Parallel Processing Shell Script" -SCRIPT_VERSION="1.06" +SCRIPT_VERSION="1.08" RUNNING_SIGNAL="$0_is_running" GLOBAL_LOCK="PPSS-$RANDOM-$RANDOM" @@ -544,12 +544,15 @@ commando () { ITEM="$1" - if [ -e "$JOB_LOG_DIR/$ITEM" ] + LOG_FILE_NAME=`echo $ITEM | sed s/^\\.//g | sed s/^\\.\\.//g | sed s/\\\///g` + ITEM_LOG_FILE="$JOB_LOG_DIR/$LOG_FILE_NAME" + + if [ -e "$ITEM_LOG_FILE" ] then - log DEBUG "Skipping item $ITEM - already processed." # <-- disabled because of possible performance penalty. + log DEBUG "Skipping item $ITEM - already processed." else - #log DEBUG "Starting command on item $ITEM." # <-- disabled because of possible performance penalty. - EXECME='$COMMAND"$ITEM" > "$JOB_LOG_DIR/$ITEM" 2>&1' + + EXECME='$COMMAND"$ITEM" > "$ITEM_LOG_FILE" 2>&1' eval "$EXECME" fi