Changeset 710
- Timestamp:
- 09/27/12 16:23:09 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
r705 r710 990 990 fi 991 991 992 typeset NB_ESSAI DELAI RETi exist skip992 typeset NB_ESSAI DELAI status i exist skip 993 993 994 994 # number of tentative … … 1053 1053 # USUAL WAY 1054 1054 \cp $1 $2 > out_rsync 2>&1 1055 RET=$?1056 if [ ${ RET} -gt 0 ]; then1055 status=$? 1056 if [ ${status} -gt 0 ]; then 1057 1057 IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed ${i}/${NB_ESSAI}" 1058 1058 IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again." … … 1073 1073 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1074 1074 1075 # RET=$?1076 # IGCM_sys_Rsync_out $ RET1075 # status=$? 1076 # IGCM_sys_Rsync_out $status 1077 1077 1078 1078 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1079 # (( RET=RET+$? ))1080 1081 if [ ${ RET} -gt 0 ] ; then1079 # (( status=status+$? )) 1080 1081 if [ ${status} -gt 0 ] ; then 1082 1082 echo "IGCM_sys_Put_Out : error." 1083 1083 cat out_rsync … … 1103 1103 echo "IGCM_sys_PutBuffer_Out :" $@ 1104 1104 fi 1105 1106 typeset NB_ESSAI DELAI status i exist skip 1107 1108 # number of tentative 1109 NB_ESSAI=3 1110 # time delay between tentative 1111 DELAI=2 1112 1105 1113 if [ $DRYRUN = 0 ]; then 1106 1114 if [ ! -f ${1} ] ; then … … 1112 1120 IGCM_sys_Mkdir $( dirname $2 ) 1113 1121 # 1114 typeset RET1115 1122 1116 1123 if [ X${JobType} = XRUN ] ; then … … 1119 1126 fi 1120 1127 fi 1128 1129 exist=false 1130 skip=false 1131 if [ -f $2 ] ; then 1132 IGCM_debug_Print 1 "$2 already exist" 1133 exist=true 1134 if [ "X$( diff $1 $2 )" = X ] ; then 1135 IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 1136 skip=true 1137 else 1138 IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy" 1139 skip=false 1140 fi 1141 fi 1121 1142 # 1122 # USUAL WAY 1123 #\cp $1 $2 > out_rsync 2>&1 1124 \mv $1 $2 > out_rsync 2>&1 1125 1126 RET=$? 1127 1128 if [ ${RET} -gt 0 ] ; then 1143 if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then 1144 IGCM_sys_Chmod u+w $2 1145 fi 1146 1147 if [ X${skip} = Xfalse ] ; then 1148 i=0 1149 while [ $i -lt $NB_ESSAI ] ; do 1150 # USUAL WAY 1151 #\cp $1 $2 > out_rsync 2>&1 1152 \mv $1 $2 > out_rsync 2>&1 1153 status=$? 1154 if [ ${status} -gt 0 ]; then 1155 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed ${i}/${NB_ESSAI}" 1156 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again." 1157 sleep $DELAI 1158 else 1159 break 1160 fi 1161 (( i = i + 1 )) 1162 done 1163 fi 1164 1165 if [ ${status} -gt 0 ] ; then 1129 1166 echo "IGCM_sys_PutBuffer_Out : error." 1130 1167 cat out_rsync
Note: See TracChangeset
for help on using the changeset viewer.