Last change
on this file since 468 was
450,
checked in by lfita, 10 years ago
|
Adding script to run shell scripts on a PBS queue system
|
File size:
938 bytes
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | ## Job Name |
---|
4 | #PBS -N r_script |
---|
5 | |
---|
6 | ## Script to run a script in camelot, IPSL |
---|
7 | #PBS -m ae |
---|
8 | #PBS -M lluis.fita@lmd.jussieu.fr |
---|
9 | |
---|
10 | ## Joins standard and Error outputs in a single file |
---|
11 | #PBS -j oe |
---|
12 | |
---|
13 | ## Queue |
---|
14 | #PBS -q day |
---|
15 | |
---|
16 | ### Max run time |
---|
17 | #PBS -l walltime=12:00:00 |
---|
18 | |
---|
19 | ### Max memory |
---|
20 | #PBS -l vmem=20gb |
---|
21 | #PBS -l mem=20gb |
---|
22 | |
---|
23 | ## resources |
---|
24 | #PBS -l nodes=1:ppn=1 |
---|
25 | |
---|
26 | cd $PBS_O_WORKDIR |
---|
27 | |
---|
28 | Lscriptname=`expr length ${scriptname}0` |
---|
29 | if test ${Lscriptname} -le 1; then |
---|
30 | echo "ERROR -- error -- ERROR -- error" |
---|
31 | echo " No script name provided!!" |
---|
32 | exit |
---|
33 | fi |
---|
34 | |
---|
35 | echo "running '"${scriptname}"' ..." |
---|
36 | |
---|
37 | dateval=`date "+%Y%m%d%H%M%S"` |
---|
38 | |
---|
39 | rm ${PBS_JOBNAME}.o* |
---|
40 | rm run_${scriptname}_*.log |
---|
41 | |
---|
42 | date > run_${scriptname}_${dateval}.log |
---|
43 | bash ${scriptname} >& r_script0_${dateval}.log |
---|
44 | cat r_script0_${dateval}.log >> run_${scriptname}_${dateval}.log |
---|
45 | rm r_script0_${dateval}.log |
---|
46 | date >> run_${scriptname}_${dateval}.log |
---|
47 | |
---|
48 | ## e.g. # qsub -v scriptname='WRF_graphics.bash' run_script.pbs |
---|
Note: See
TracBrowser
for help on using the repository browser.