fixing cleanup exitcode problem
This commit is contained in:
@@ -78,10 +78,14 @@ minutes_now=$( date "+%M" )
|
||||
|
||||
# send the job
|
||||
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
|
||||
|
||||
exitcode=$?
|
||||
# clear out old job definitions (semirandomly)
|
||||
if [ ! $( date "+%M" ) -eq $minutes_now ]
|
||||
then find "$JOBROOT" -maxdepth 2 -mindepth 2 -type f -mtime +10 -delete
|
||||
[[ -e "$JOBROOT"/.lastdel ]] || touch "$JOBROOT"/.lastdel
|
||||
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
|
||||
fi
|
||||
|
||||
exit $exitcode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user