Example 2: One node batch job showing several useful features
REM set CCS required keywords
REM CCS account = userid
REM CCS nodes = 1
REM CCS type = batch
REM CCS minutes = 10
REM Remember, you may log into your batch nodes interactively
REM regardless of whether type was set to interactive or batch.
REM set some variables that can easily be changed from run to run
set ROOTDIR=\\tc.cornell.edu\tc\users\userid\bat\misc
set CODE=karp.exe
REM create a working subdirectory on the local temp drive
cd /D T:\
del /Q T:\%USERNAME%
mkdir %USERNAME%
cd %USERNAME%
REM clean up any preexisting files
del /S /Q T:\%USERNAME%
REM copy the necessary files into the working directory
copy %ROOTDIR%\%CODE% T:\%USERNAME%
REM check that you have all the files you need in the
REM current working directory
dir > %ROOTDIR%\allfiles.txt
REM email a message that job is starting
call notify email_address "Batch job has started"
REM time the job by writing timestamps to a file
REM be sure to use the /T flag to specify that the time be output;
REM otherwise it will prompt for a new date or time.
echo Begin at: > time.txt
time /T >> time.txt
date /T >> time.txt
REM run the job
%CODE% 1>run.stdout 2>run.stderr
REM time the job by writing timestamps to a file
echo End at: >> time.txt
time /T >> time.txt
date /T >> time.txt
REM copy output files to the file server
copy *.* %ROOTDIR%
REM clean up files
del /S /Q T:\%USERNAME%
REM email a message that the job is ending
call notify email_address "Batch job has ended"
REM release resources
ccrelease