1 | #!/bin/ksh |
---|
2 | # $Id$ |
---|
3 | #----------------------------------------------- |
---|
4 | #- Installation de scripts de post_traitement |
---|
5 | #----------------------------------------------- |
---|
6 | d_n=$(dirname ${0}); b_n=$(basename ${0}); |
---|
7 | |
---|
8 | #- Saisie et validation des options |
---|
9 | x_v='silencious'; |
---|
10 | x_d='normal'; |
---|
11 | x_t=""; |
---|
12 | x_n=""; |
---|
13 | |
---|
14 | while getopts :hvd:t: ops |
---|
15 | do |
---|
16 | case $ops in |
---|
17 | (h) echo "Usage : "${b_n} \ |
---|
18 | " [-h] [-v] [-d] [-t h] [-n f]"; |
---|
19 | echo " -h : help"; |
---|
20 | echo " -v : verbose mode"; |
---|
21 | echo " -d : debug mode"; |
---|
22 | echo " -t h : target host_name"; |
---|
23 | echo "Defaults : -t local_host"; |
---|
24 | exit 0;; |
---|
25 | (v) x_v='verbose';; |
---|
26 | (d) x_d='debug';; |
---|
27 | (t) x_t=${OPTARG};; |
---|
28 | (:) echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; |
---|
29 | exit 2;; |
---|
30 | (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2; |
---|
31 | exit 2;; |
---|
32 | esac |
---|
33 | done |
---|
34 | shift $(($OPTIND-1)); |
---|
35 | |
---|
36 | if [ "$x_t" = "sx8brodie" ]; then |
---|
37 | b_n_post=$(basename $HOME) |
---|
38 | d_n_post=$(dirname $HOME | sed 's/home/u/') |
---|
39 | elif [ "$x_t" = "fjvpp" ]; then |
---|
40 | b_n_post=$(basename $DMFDIR) |
---|
41 | d_n_post=\/$(dirname $DMFDIR | awk -F\/ '{print $4}') |
---|
42 | elif [ "$x_t" = "sx6nec" ]; then |
---|
43 | b_n_post=$(basename $DMFDIR) |
---|
44 | d_n_post=$(dirname $DMFDIR) |
---|
45 | elif [ "$x_t" = "sx8mercure" ]; then |
---|
46 | b_n_post=$(basename $DMFDIR) |
---|
47 | d_n_post=$(dirname $DMFDIR) |
---|
48 | else |
---|
49 | echo " !!! WARNING !!!" |
---|
50 | echo " The path for the output files on the storage server," |
---|
51 | echo " needed for post-traitement files, is not automaticaly set." |
---|
52 | echo " Please specify manually this path by replacing the AAAAAAA" |
---|
53 | echo " string in the Output Job with the desired path." |
---|
54 | echo " !!! WARNING !!!" |
---|
55 | fi |
---|
56 | #- Traitement des options |
---|
57 | #- REAL precision |
---|
58 | # Target_Host Name |
---|
59 | if [ '\?'${x_t} = '\?' ]; then |
---|
60 | x_t=`${d_n}/w_i_h`; |
---|
61 | if [ $? -ne 0 ]; then |
---|
62 | echo "Bad installation : w_i_h/uname unreachable" 1>&2; |
---|
63 | exit 1; |
---|
64 | elif [ "$x_t" = "Unknown" ]; then |
---|
65 | echo "Local_Host not supported" 1>&2; |
---|
66 | exit 1; |
---|
67 | fi; |
---|
68 | fi; |
---|
69 | |
---|
70 | case ${x_t} in |
---|
71 | ( aix | cray | fjvpp | linux | lxiv7 | lxiv8 | osf1 | \ |
---|
72 | solaris | t3e | sx8brodie | sx6nec | sx8mercure | unix ) ;; |
---|
73 | (*) |
---|
74 | echo "Target_Host "${x_t}" not supported" 1>&2; |
---|
75 | exit 1;; |
---|
76 | esac |
---|
77 | #- |
---|
78 | x_m=$( (cd $d_n ; pwd) | sed -e "s,/util,," ) |
---|
79 | |
---|
80 | if [ ${x_v} = 'verbose' ]; then |
---|
81 | echo '--- Mode : '${x_v}; |
---|
82 | echo '--- Compilation : '${x_d}; |
---|
83 | echo '--- Target : '${x_t}; |
---|
84 | echo '--- Name : '${x_n}; |
---|
85 | echo '--- MODIPSL directory : '${x_m}; |
---|
86 | fi; |
---|
87 | #- |
---|
88 | #- |
---|
89 | l_rep1=`find ${d_n}/.. -name mo2st -print` |
---|
90 | l_rep2=`find ${d_n}/.. -name da2st -print` |
---|
91 | l_rep3=`find ${d_n}/.. -name mo2se -print` |
---|
92 | l_rep4=`find ${d_n}/.. -name da2mo -print` |
---|
93 | l_rep5=`find ${d_n}/.. -name da4mo -print` |
---|
94 | l_rep6=`find ${d_n}/.. -name da2ye -print` |
---|
95 | l_rep7=`find ${d_n}/.. -name da4ye -print` |
---|
96 | l_rep8=`find ${d_n}/.. -name mo2ye -print` |
---|
97 | l_rep9=`find ${d_n}/.. -name mo4ye -print` |
---|
98 | l_rep10=`find ${d_n}/.. -name mo2sn -print` |
---|
99 | l_rep11=`find ${d_n}/.. -name da2sn -print` |
---|
100 | l_rep12=`find ${d_n}/.. -name txt2tar -print` |
---|
101 | l_rep13=`find ${d_n}/.. -name monitoring_script -print` |
---|
102 | l_rep14=`find ${d_n}/.. -name monitoring_loop_script -print` |
---|
103 | l_rep15=`find ${d_n}/.. -name monitoring_loop2_script -print` |
---|
104 | l_rep16=`find ${d_n}/.. -name atlas_cpl_se_ORCA_LIM -print` |
---|
105 | l_rep17=`find ${d_n}/.. -name atlas_cpl_se -print` |
---|
106 | l_rep18=`find ${d_n}/.. -name atlas_cpl_se_LMDZOR -print` |
---|
107 | l_rep19=`find ${d_n}/.. -name atlas_cpl_se_ORCA_LIM2 -print` |
---|
108 | l_rep20=`find ${d_n}/.. -name create_ts -print` |
---|
109 | #- |
---|
110 | #- |
---|
111 | |
---|
112 | |
---|
113 | W_OS=${x_t}; |
---|
114 | |
---|
115 | if [ ${W_OS} = "sx8brodie" ]; then |
---|
116 | format='\s' |
---|
117 | elif [ ${W_OS} = "fjvpp" ]; then |
---|
118 | format='\d' |
---|
119 | elif [ ${W_OS} = "sx6nec" ]; then |
---|
120 | format='\g' |
---|
121 | elif [ ${W_OS} = "sx8mercure" ]; then |
---|
122 | format='\g' |
---|
123 | else |
---|
124 | echo " !!! WARNING !!!" |
---|
125 | echo " The display format of numbers," |
---|
126 | echo " needed for the dates, is not automaticaly set." |
---|
127 | echo " Please specify manually this format by replacing the PPPPPPP" |
---|
128 | echo " string in the Output Job with the desired format." |
---|
129 | echo " !!! WARNING !!!" |
---|
130 | fi |
---|
131 | |
---|
132 | echo " "; |
---|
133 | echo "Installation of simple execution jobs for $W_OS"; |
---|
134 | echo " "; |
---|
135 | #- |
---|
136 | |
---|
137 | for i in $l_rep1 $l_rep2 $l_rep3 $l_rep4 $l_rep5 $l_rep6 $l_rep7 $l_rep8 $l_rep9 $l_rep10 $l_rep11 $l_rep12 $l_rep13 $l_rep14 $l_rep15 $l_rep16 $l_rep17 $l_rep18 $l_rep19 $l_rep20 |
---|
138 | do |
---|
139 | echo " " |
---|
140 | case $i in |
---|
141 | "$l_rep1") j=$(dirname $i); |
---|
142 | MKTR="$j"; |
---|
143 | r=$(cd $j ; pwd); |
---|
144 | echo "Installation of mo2st.job file in directory : $(cd $j ; pwd) "; |
---|
145 | typeset -R W_XX[1]; |
---|
146 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
147 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2st | grep -v '^#-Q- ' $1 > ${r}/mo2st.job ;; |
---|
148 | "$l_rep2") j=$(dirname $i); |
---|
149 | MKTR="$j"; |
---|
150 | r=$(cd $j ; pwd); |
---|
151 | echo "Installation of da2st.job file in directory : $(cd $j ; pwd) "; |
---|
152 | typeset -R W_XX[1]; |
---|
153 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
154 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2st | grep -v '^#-Q- ' $1 > ${r}/da2st.job ;; |
---|
155 | "$l_rep3") j=$(dirname $i); |
---|
156 | MKTR="$j"; |
---|
157 | r=$(cd $j ; pwd); |
---|
158 | echo "Installation of mo2se.job file in directory : $(cd $j ; pwd) "; |
---|
159 | typeset -R W_XX[1]; |
---|
160 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
161 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2se | grep -v '^#-Q- ' $1 > ${r}/mo2se.job ;; |
---|
162 | "$l_rep4") j=$(dirname $i); |
---|
163 | MKTR="$j"; |
---|
164 | r=$(cd $j ; pwd); |
---|
165 | echo "Installation of da2mo.job file in directory : $(cd $j ; pwd) "; |
---|
166 | typeset -R W_XX[1]; |
---|
167 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
168 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2mo | grep -v '^#-Q- ' $1 > ${r}/da2mo.job ;; |
---|
169 | "$l_rep5") j=$(dirname $i); |
---|
170 | MKTR="$j"; |
---|
171 | r=$(cd $j ; pwd); |
---|
172 | echo "Installation of da4mo.job file in directory : $(cd $j ; pwd) "; |
---|
173 | typeset -R W_XX[1]; |
---|
174 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
175 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da4mo | grep -v '^#-Q- ' $1 > ${r}/da4mo.job ;; |
---|
176 | "$l_rep6") j=$(dirname $i); |
---|
177 | MKTR="$j"; |
---|
178 | r=$(cd $j ; pwd); |
---|
179 | echo "Installation of da2ye.job file in directory : $(cd $j ; pwd) "; |
---|
180 | typeset -R W_XX[1]; |
---|
181 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
182 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2ye | grep -v '^#-Q- ' $1 > ${r}/da2ye.job ;; |
---|
183 | "$l_rep7") j=$(dirname $i); |
---|
184 | MKTR="$j"; |
---|
185 | r=$(cd $j ; pwd); |
---|
186 | echo "Installation of da4ye.job file in directory : $(cd $j ; pwd) "; |
---|
187 | typeset -R W_XX[1]; |
---|
188 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
189 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da4ye | grep -v '^#-Q- ' $1 > ${r}/da4ye.job ;; |
---|
190 | "$l_rep8") j=$(dirname $i); |
---|
191 | MKTR="$j"; |
---|
192 | r=$(cd $j ; pwd); |
---|
193 | echo "Installation of mo2ye.job file in directory : $(cd $j ; pwd) "; |
---|
194 | typeset -R W_XX[1]; |
---|
195 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
196 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2ye | grep -v '^#-Q- ' $1 > ${r}/mo2ye.job ;; |
---|
197 | "$l_rep9") j=$(dirname $i); |
---|
198 | MKTR="$j"; |
---|
199 | r=$(cd $j ; pwd); |
---|
200 | echo "Installation of mo4ye.job file in directory : $(cd $j ; pwd) "; |
---|
201 | typeset -R W_XX[1]; |
---|
202 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
203 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo4ye | grep -v '^#-Q- ' $1 > ${r}/mo4ye.job ;; |
---|
204 | "$l_rep10") j=$(dirname $i); |
---|
205 | MKTR="$j"; |
---|
206 | r=$(cd $j ; pwd); |
---|
207 | echo "Installation of mo2sn.job file in directory : $(cd $j ; pwd) "; |
---|
208 | typeset -R W_XX[1]; |
---|
209 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
210 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/mo2sn | grep -v '^#-Q- ' $1 > ${r}/mo2sn.job ;; |
---|
211 | "$l_rep11") j=$(dirname $i); |
---|
212 | MKTR="$j"; |
---|
213 | r=$(cd $j ; pwd); |
---|
214 | echo "Installation of da2sn.job file in directory : $(cd $j ; pwd) "; |
---|
215 | typeset -R W_XX[1]; |
---|
216 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
217 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/da2sn | grep -v '^#-Q- ' $1 > ${r}/da2sn.job ;; |
---|
218 | "$l_rep12") j=$(dirname $i); |
---|
219 | MKTR="$j"; |
---|
220 | r=$(cd $j ; pwd); |
---|
221 | echo "Installation of txt2tar.job file in directory : $(cd $j ; pwd) "; |
---|
222 | typeset -R W_XX[1]; |
---|
223 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
224 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/txt2tar | grep -v '^#-Q- ' $1 > ${r}/txt2tar.job ;; |
---|
225 | "$l_rep13") j=$(dirname $i); |
---|
226 | MKTR="$j"; |
---|
227 | r=$(cd $j ; pwd); |
---|
228 | echo "Installation of monitoring_script.job file in directory : $(cd $j ; pwd) "; |
---|
229 | typeset -R W_XX[1]; |
---|
230 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
231 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/monitoring_script | grep -v '^#-Q- ' $1 > ${r}/monitoring_script.job ;; |
---|
232 | "$l_rep14") j=$(dirname $i); |
---|
233 | MKTR="$j"; |
---|
234 | r=$(cd $j ; pwd); |
---|
235 | echo "Installation of monitoring_loop_script.job file in directory : $(cd $j ; pwd) "; |
---|
236 | typeset -R W_XX[1]; |
---|
237 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
238 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/monitoring_loop_script | grep -v '^#-Q- ' $1 > ${r}/monitoring_loop_script.job ;; |
---|
239 | "$l_rep15") j=$(dirname $i); |
---|
240 | MKTR="$j"; |
---|
241 | r=$(cd $j ; pwd); |
---|
242 | echo "Installation of monitoring_loop2_script.job file in directory : $(cd $j ; pwd) "; |
---|
243 | typeset -R W_XX[1]; |
---|
244 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS ; |
---|
245 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/monitoring_loop2_script | grep -v '^#-Q- ' $1 > ${r}/monitoring_loop2_script.job ;; |
---|
246 | "$l_rep16") j=$(dirname $i); |
---|
247 | MKTR="$j"; |
---|
248 | r=$(cd $j ; pwd); |
---|
249 | echo "Installation of atlas_cpl_se_ORCA_LIM.job file in directory : $(cd $j ; pwd) "; |
---|
250 | typeset -R W_XX[1]; |
---|
251 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
252 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se_ORCA_LIM | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se_ORCA_LIM.job ;; |
---|
253 | "$l_rep17") j=$(dirname $i); |
---|
254 | MKTR="$j"; |
---|
255 | r=$(cd $j ; pwd); |
---|
256 | echo "Installation of atlas_cpl_se.job file in directory : $(cd $j ; pwd) "; |
---|
257 | typeset -R W_XX[1]; |
---|
258 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
259 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se.job ;; |
---|
260 | "$l_rep18") j=$(dirname $i); |
---|
261 | MKTR="$j"; |
---|
262 | r=$(cd $j ; pwd); |
---|
263 | echo "Installation of atlas_cpl_se_LMDZOR.job file in directory : $(cd $j ; pwd) "; |
---|
264 | typeset -R W_XX[1]; |
---|
265 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
266 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se_LMDZOR | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se_LMDZOR.job ;; |
---|
267 | "$l_rep19") j=$(dirname $i); |
---|
268 | MKTR="$j"; |
---|
269 | r=$(cd $j ; pwd); |
---|
270 | echo "Installation of atlas_cpl_se_ORCA_LIM2.job file in directory : $(cd $j ; pwd) "; |
---|
271 | typeset -R W_XX[1]; |
---|
272 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
273 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/atlas_cpl_se_ORCA_LIM2 | grep -v '^#-Q- ' $1 > ${r}/atlas_cpl_se_ORCA_LIM2.job ;; |
---|
274 | "$l_rep20") j=$(dirname $i); |
---|
275 | MKTR="$j"; |
---|
276 | r=$(cd $j ; pwd); |
---|
277 | echo "Installation of create_ts.job file in directory : $(cd $j ; pwd) "; |
---|
278 | typeset -R W_XX[1]; |
---|
279 | set -A W_XX '\#\-D\-' '#-Q- '$W_OS; |
---|
280 | sed -e "/^.*${W_XX[0]}$/d" -e "s,^${W_XX[1]}*,," -e "s,AAAAAAA,${d_n_post}\/${b_n_post},g" -e "s,PPPPPPP,${format},g" ${MKTR}/create_ts | grep -v '^#-Q- ' $1 > ${r}/create_ts.job ;; |
---|
281 | esac |
---|
282 | done |
---|
283 | echo " "; |
---|
284 | exit 0; |
---|