Skip to content

Instantly share code, notes, and snippets.

@rocarvaj
Created July 3, 2015 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rocarvaj/d5df7c43c78505388547 to your computer and use it in GitHub Desktop.
Save rocarvaj/d5df7c43c78505388547 to your computer and use it in GitHub Desktop.
Sun Grid Engine job script example from https://web.njit.edu/topics/HPC/basement/sge/SGE.html
#!/bin/sh
#
# Usage: sleeper.sh [time]]
# default for time is 60 seconds
# -- our name ---
#$ -N Sleeper1
#$ -S /bin/sh
# Make sure that the .e and .o file arrive in the
# working directory
#$ -cwd
#Merge the standard out and standard error to one file
#$ -j y
/bin/echo Here I am: `hostname`. Sleeping now at: `date`
/bin/echo Running on host: `hostname`.
/bin/echo In directory: `pwd`
/bin/echo Starting on: `date`
# Send mail at submission and completion of script
#$ -m be
#$ -M deadline@kronos
time=60
if [ $# -ge 1 ]; then
time=$1
fi
sleep $time
echo Now it is: `date`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment