fixing cleanup exitcode problem

This commit is contained in:
ville rantanen
2014-02-25 13:02:37 +02:00
parent 675c5d6c81
commit c68ffa5fb5

View File

@@ -78,10 +78,14 @@ minutes_now=$( date "+%M" )
# send the job # send the job
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE" srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
exitcode=$?
# clear out old job definitions (semirandomly) # clear out old job definitions (semirandomly)
if [ ! $( date "+%M" ) -eq $minutes_now ] [[ -e "$JOBROOT"/.lastdel ]] || touch "$JOBROOT"/.lastdel
then find "$JOBROOT" -maxdepth 2 -mindepth 2 -type f -mtime +10 -delete if test "$( find $JOBROOT/.lastdel -mmin +30 )"
then touch "$JOBROOT"/.lastdel
find "$JOBROOT" -maxdepth 2 -mindepth 2 -type f -mtime +10 -delete
find "$JOBROOT" -type d -depth -empty -delete find "$JOBROOT" -type d -depth -empty -delete
fi fi
exit $exitcode