gridengine/bin/pro-epilog_wrapper.sh
Kasper D. Fischer d9ca7c3127 Add support for pe_prolog and pe_epilog files
Send all command line args to the files to be run
Add script to remove empty *.pe* and *.po* files after running pe jobs
Scripts expect this 11 commandline arguments: $pe_hostfile $host $job_owner $job_id $job_name $pe $pe_slots $queue $stdout_path $stderr_path $merge_stderr
2021-05-25 13:22:39 +02:00

21 lines
457 B
Bash
Executable File

#!/bin/bash
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
FILES=""
SCRIPTNAME=$(basename $0)
DIRS="/opt/SGE/local/${SCRIPTNAME}.d /usr/local/etc/gridengine/${SCRIPTNAME}.d"
for DIR in ${DIRS} ; do
if [ -d ${DIR} ] ; then
if [ ! -z "$(ls ${DIR}/[0-9][0-9]*)" ] ; then
FILES="${FILES} $(ls ${DIR}/[0-9][0-9]*)"
fi
fi
done
FILESSORTED="$(echo ${FILES} | sort)"
for FILE in ${FILESSORTED} ; do
${FILE} $@ || exit $?
done
exit 0