Changeset 711
- Timestamp:
- 09/27/12 16:31:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
r709 r711 1212 1212 fi 1213 1213 1214 typeset NB_ESSAI DELAI RET i1214 typeset NB_ESSAI DELAI status i exist skip 1215 1215 1216 1216 # number of tentative … … 1250 1250 # 1251 1251 1252 (( i = 0 )) 1253 while [ $i -lt $NB_ESSAI ] ; do 1254 # USUAL WAY 1255 \cp $1 $2 > out_rsync 2>&1 1256 RET=$? 1257 if [ ${RET} -gt 0 ]; then 1258 IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed ${i}/${NB_ESSAI}" 1259 IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again." 1260 sleep $DELAI 1252 exist=false 1253 skip=false 1254 if [ -f $2 ] ; then 1255 IGCM_debug_Print 1 "$2 already exist" 1256 #dmget $2 1257 ccc_hsm get $2 1258 exist=true 1259 if [ "X$( diff $1 $2 )" = X ] ; then 1260 IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 1261 skip=true 1261 1262 else 1262 break 1263 IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy" 1264 skip=false 1263 1265 fi 1264 (( i = i + 1 )) 1265 done 1266 fi 1267 # 1268 if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then 1269 IGCM_sys_Chmod u+w $2 1270 fi 1271 1272 if [ X${skip} = Xfalse ] ; then 1273 (( i = 0 )) 1274 while [ $i -lt $NB_ESSAI ] ; do 1275 # USUAL WAY 1276 \cp $1 $2 > out_rsync 2>&1 1277 status=$? 1278 if [ ${status} -gt 0 ]; then 1279 IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed ${i}/${NB_ESSAI}" 1280 IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again." 1281 sleep $DELAI 1282 else 1283 break 1284 fi 1285 (( i = i + 1 )) 1286 done 1287 fi 1266 1288 1267 1289 # #RSYNC WITH NETWORK SSH CALL … … 1273 1295 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1274 1296 1275 # RET=$?1276 # IGCM_sys_Rsync_out $ RET1297 # status=$? 1298 # IGCM_sys_Rsync_out $status 1277 1299 1278 1300 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1279 # (( RET=RET+$? ))1280 1281 if [ ${ RET} -gt 0 ] ; then1301 # (( status=status+$? )) 1302 1303 if [ ${status} -gt 0 ] ; then 1282 1304 echo "IGCM_sys_Put_Out : error." 1283 1305 cat out_rsync … … 1303 1325 echo "IGCM_sys_PutBuffer_Out :" $@ 1304 1326 fi 1327 1328 typeset NB_ESSAI DELAI status i exist skip 1329 1330 # number of tentative 1331 NB_ESSAI=3 1332 # time delay between tentative 1333 DELAI=2 1334 1305 1335 if [ $DRYRUN = 0 ]; then 1306 1336 if [ ! -f ${1} ] ; then … … 1312 1342 IGCM_sys_Mkdir $( dirname $2 ) 1313 1343 # 1314 typeset RET1315 1344 1316 1345 if [ X${JobType} = XRUN ] ; then … … 1319 1348 fi 1320 1349 fi 1350 1351 exist=false 1352 skip=false 1353 if [ -f $2 ] ; then 1354 IGCM_debug_Print 1 "$2 already exist" 1355 exist=true 1356 if [ "X$( diff $1 $2 )" = X ] ; then 1357 IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy" 1358 skip=true 1359 else 1360 IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy" 1361 skip=false 1362 fi 1363 fi 1321 1364 # 1322 # USUAL WAY 1323 \cp $1 $2 > out_rsync 2>&1 1324 RET=$? 1325 1326 if [ ${RET} -gt 0 ] ; then 1365 if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then 1366 IGCM_sys_Chmod u+w $2 1367 fi 1368 1369 if [ X${skip} = Xfalse ] ; then 1370 i=0 1371 while [ $i -lt $NB_ESSAI ] ; do 1372 # USUAL WAY 1373 \cp $1 $2 > out_rsync 2>&1 1374 status=$? 1375 if [ ${status} -gt 0 ]; then 1376 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed ${i}/${NB_ESSAI}" 1377 IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again." 1378 sleep $DELAI 1379 else 1380 break 1381 fi 1382 (( i = i + 1 )) 1383 done 1384 fi 1385 1386 if [ ${status} -gt 0 ] ; then 1327 1387 echo "IGCM_sys_PutBuffer_Out : error." 1328 1388 cat out_rsync … … 1637 1697 echo "IGCM_sys_Put_Dods :" $@ 1638 1698 fi 1639 set -vx1699 #set -vx 1640 1700 typeset RET 1641 1701 if [ $DRYRUN = 0 ]; then
Note: See TracChangeset
for help on using the changeset viewer.