Changeset 1178 for trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
- Timestamp:
- 03/30/15 14:17:55 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
r1163 r1178 213 213 function IGCM_sys_RshMaster { 214 214 IGCM_debug_PushStack "IGCM_sys_RshMaster" $@ 215 /bin/ksh 215 /bin/ksh <<-EOF 216 216 export libIGCM=${libIGCM} 217 217 export DEBUG_debug=${DEBUG_debug} … … 246 246 247 247 #D-#================================================== 248 #D-function IGCM_sys_RshArchive_NoError 249 #D-* Purpose: Archive rsh command, without error 250 #D-* used only in monitoring.job 251 #D-* Examples: 252 #D- 253 function IGCM_sys_RshArchive_NoError { 254 IGCM_debug_PushStack "IGCM_sys_RshArchive_NoError" $@ 255 /bin/ksh <<-EOF 256 ${@} 2> \dev\null 257 EOF 258 IGCM_debug_PopStack "IGCM_sys_RshArchive_NoError" 259 } 260 261 #D-#================================================== 248 262 #D-function IGCM_sys_RshPost 249 263 #D-* Purpose: Post-process rsh command … … 255 269 echo "IGCM_sys_RshPost :" $@ 256 270 fi 257 258 271 # keep standard input (stdin) for the loop onto temporary file 259 cat >tmp_IGCM_sys_RshPost_$$ 260 261 # ============ FRONTEND START ============ # 262 263 /bin/ksh <tmp_IGCM_sys_RshPost_$$ 272 cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 273 274 /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 264 275 if [ $? -gt 0 ] ; then 265 276 echo "IGCM_sys_RshPost : erreur." … … 267 278 fi 268 279 # delete temporary file 269 \rm tmp_IGCM_sys_RshPost_$$280 \rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} 270 281 IGCM_debug_PopStack "IGCM_sys_RshPost" 271 282 } … … 299 310 300 311 if [ ! -z ${config_UserChoices_MailName} ] ; then 301 mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt312 mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt 302 313 elif [ -f ~/.forward ] ; then 303 314 mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt … … 347 358 #- creation de repertoire sur le serveur fichier 348 359 if [ ! -d ${1} ]; then 349 mkdir -p $1360 \mkdir -p $1 350 361 status=$? 351 362 … … 930 941 fi 931 942 if [ $DRYRUN = 0 ]; then 932 if [ ! -d ${1} ] ; then933 echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."934 IGCM_debug_PopStack "IGCM_sys_Get_Dir"935 return936 fi937 938 943 typeset status 939 944 … … 1026 1031 typeset status 1027 1032 # 1028 if [ X${JobType} = XRUN ] ; then 1029 IGCM_sys_Chmod 444 ${1} 1030 fi 1031 # 1032 # Only if we use rsync 1033 #IGCM_sys_MkdirArchive $( dirname $2 ) 1034 # 1035 #USUAL WAY 1036 \cp $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 1033 # USUAL WAY 1034 \cp $1 $2 > /tmp/out_command.$$ 2>&1 1037 1035 status=$? 1038 1036 … … 1053 1051 if [ ${status} -gt 0 ] ; then 1054 1052 echo "IGCM_sys_Put_Rest : cp failed error code ${status}" 1055 cat /tmp/out_command_${LOGIN}.$$ 1053 [ -f ${1} ] && ls -l ${1} 1054 [ -f ${2} ] && ls -l ${2} 1055 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1056 cat /tmp/out_command.$$ 1056 1057 IGCM_debug_Exit "IGCM_sys_Put_Rest" 1057 1058 else 1058 \rm /tmp/out_command_${LOGIN}.$$ 1059 1060 if [ X${JobType} = XRUN ] ; then 1061 [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 1062 [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 1063 fi 1064 1065 \rm /tmp/out_command.$$ 1059 1066 fi 1060 1067 fi … … 1080 1087 1081 1088 typeset status 1082 #1083 if [ X${JobType} = XRUN ] ; then1084 IGCM_sys_Chmod 444 ${1}1085 fi1086 1087 1089 # 1088 1090 # USUAL WAY … … 1097 1099 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 1098 1100 else 1099 \rm /tmp/out_command_${LOGIN}.$$ 1101 1102 if [ X${JobType} = XRUN ] ; then 1103 [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 1104 [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 1105 fi 1106 1107 \rm /tmp/out_command.$$ 1100 1108 fi 1101 1109 fi … … 1213 1221 i=0 1214 1222 while [ $i -lt $NB_ESSAI ] ; do 1215 # USUAL WAY 1216 \cp $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1 1217 status=$? 1223 if [ $( stat -c %d $1 ) -ne $( stat -c %d $( dirname $2 ) ) ] ; then 1224 # USUAL WAY 1225 \cp $1 $2 > /tmp/out_command.$$ 2>&1 1226 status=$? 1227 else 1228 # NOT SO USUAL WAY 1229 \mv $1 $2 > /tmp/out_command.$$ 2>&1 1230 status=$? 1231 fi 1218 1232 if [ ${status} -gt 0 ]; then 1219 1233 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}" … … 1233 1247 [ -f ${2} ] && ls -l ${2} 1234 1248 [ -f ${2}/${1} ] && ls -l ${2}/${1} 1235 cat /tmp/out_command _${LOGIN}.$$1249 cat /tmp/out_command.$$ 1236 1250 IGCM_debug_Exit "IGCM_sys_PutBuffer_Out" 1237 1251 else … … 1387 1401 echo "IGCM_sys_GetDate_FichWork :" $@ 1388 1402 fi 1403 1404 if [ $# -ge 3 ] ; then 1405 mode=$3 1406 TimeStyle=$4 1407 else 1408 mode="default" 1409 TimeStyle="%Y%m%d%H%M%S" 1410 fi 1411 1389 1412 typeset dateF 1390 set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} ) 1391 eval ${2}=${dateF[5]} 1413 set +A dateF -- $( ls -l --full-time --time-style=+"${TimeStyle}" ${1} ) 1414 1415 case $mode in 1416 "default") 1417 eval ${2}=${dateF[5]} 1418 ;; 1419 "SplitFields") 1420 eval ${2}="${dateF[5]}\ ${dateF[6]}" 1421 ;; 1422 esac 1423 1392 1424 1393 1425 # donne la date filesys d'un fichier sur la machine work … … 1577 1609 # 0 118 110.0000000000000 87.46478873239437 1578 1610 # 1 40 4.999999999999995 51.97183098591550 1611 1579 1612 # typeset iStation iProc list_opt file_in file_out prefix_invert 1580 1613 # typeset -Z4 j4
Note: See TracChangeset
for help on using the changeset viewer.