old jobs removal
This commit is contained in:
@@ -100,10 +100,16 @@ echo 'EC=$?' >> "$JOBFILE"
|
|||||||
echo "date +'Stop: %s' >> \"$STATFILE\" " >> "$JOBFILE"
|
echo "date +'Stop: %s' >> \"$STATFILE\" " >> "$JOBFILE"
|
||||||
echo 'exit $EC' >> "$JOBFILE"
|
echo 'exit $EC' >> "$JOBFILE"
|
||||||
|
|
||||||
|
# clear out old job definitions (semirandomly)
|
||||||
|
(
|
||||||
|
[[ -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
|
||||||
|
) &
|
||||||
|
|
||||||
echo "The job file is in $JOBFILE"
|
echo "The job file is in $JOBFILE"
|
||||||
# send the job
|
# send the job
|
||||||
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
|
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ do if [[ "${!i}" == */_command ]]
|
|||||||
do [ -f "'${!i}'" ] && {
|
do [ -f "'${!i}'" ] && {
|
||||||
break
|
break
|
||||||
} || {
|
} || {
|
||||||
echo Waiting for _command file "'${!i}'"
|
echo Waiting for _command file '${!i}'
|
||||||
retrys=$(( $retrys + 1 ))
|
retrys=$(( $retrys + 1 ))
|
||||||
sleep 1; [ "$retrys" -gt 15 ] && break;
|
sleep 1; [ "$retrys" -gt 15 ] && break;
|
||||||
}
|
}
|
||||||
@@ -95,6 +95,18 @@ echo 'EC=$?' >> "$JOBFILE"
|
|||||||
echo "date +'Stop: %s' >> \"$STATFILE\" " >> "$JOBFILE"
|
echo "date +'Stop: %s' >> \"$STATFILE\" " >> "$JOBFILE"
|
||||||
echo 'exit $EC' >> "$JOBFILE"
|
echo 'exit $EC' >> "$JOBFILE"
|
||||||
|
|
||||||
|
# clear out old job definitions (semirandomly)
|
||||||
|
(
|
||||||
|
[[ -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
|
||||||
|
) &
|
||||||
|
|
||||||
echo "The job file is in $JOBFILE"
|
echo "The job file is in $JOBFILE"
|
||||||
# send the job
|
# send the job
|
||||||
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
|
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
|
||||||
|
|
||||||
|
wait
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ class entry_collection:
|
|||||||
else:
|
else:
|
||||||
subprocess.call(command_str, stderr=subprocess.STDOUT, shell=True,executable="/bin/bash")
|
subprocess.call(command_str, stderr=subprocess.STDOUT, shell=True,executable="/bin/bash")
|
||||||
except:
|
except:
|
||||||
print('Unable to run: "'+command_str+'"')
|
print('Non-zero exit code: "'+command_str+'"')
|
||||||
|
|
||||||
if (self.options.command or self.options.once or bg):
|
if (self.options.command or self.options.once or bg):
|
||||||
wait=False
|
wait=False
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ function whenfilechanges() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local fname
|
local fname
|
||||||
|
local forced
|
||||||
local otime
|
local otime
|
||||||
local ntime
|
local ntime
|
||||||
local i
|
local i
|
||||||
@@ -174,7 +175,8 @@ function whenfilechanges() {
|
|||||||
date
|
date
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
sleep 2
|
read -t 2 forced
|
||||||
|
[ $? -eq 0 ] && eval "$@"
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user