369 |
|
txt += '# Copy output to SE = $SE\n' |
370 |
|
txt += '#\n' |
371 |
|
#txt += 'if [ $exe_result -eq 0 ]; then\n' |
372 |
+ |
txt += ' if [ $middleware == OSG ]; then\n' |
373 |
+ |
txt += ' echo "X509_USER_PROXY = $X509_USER_PROXY"\n' |
374 |
+ |
txt += ' echo "source $OSG_APP/glite/setup_glite_ui.sh"\n' |
375 |
+ |
txt += ' source $OSG_APP/glite/setup_glite_ui.sh\n' |
376 |
+ |
txt += ' export X509_CERT_DIR=$OSG_APP/glite/etc/grid-security/certificates\n' |
377 |
+ |
txt += ' echo "export X509_CERT_DIR=$X509_CERT_DIR"\n' |
378 |
+ |
txt += ' fi \n' |
379 |
|
txt += ' for out_file in $file_list ; do\n' |
380 |
< |
txt += ' echo "Trying to copy output file to $SE "\n' |
381 |
< |
## OLI_Daniele globus-* for OSG, lcg-* for LCG |
382 |
< |
txt += ' if [ $middleware == OSG ]; then\n' |
383 |
< |
txt += ' echo "globus-url-copy file://`pwd`/$out_file gsiftp://${SE}${SE_PATH}$out_file 2>&1"\n' |
384 |
< |
txt += ' globus-url-copy file://`pwd`/$out_file gsiftp://${SE}${SE_PATH}$out_file 2>&1 \n' |
378 |
< |
txt += ' copy_exit_status=$? \n' |
379 |
< |
txt += ' elif [ $middleware == LCG ]; then \n' |
380 |
< |
#txt += ' echo "#######################################" \n' |
381 |
< |
#txt += ' echo "#######################################" \n' |
382 |
< |
#txt += ' echo "directory: " \n' |
383 |
< |
#txt += ' pwd \n' |
384 |
< |
#txt += ' echo "files:" \n' |
385 |
< |
#txt += ' ls \n' |
386 |
< |
#txt += ' echo "#######################################" \n' |
387 |
< |
#txt += ' echo "#######################################" \n' |
388 |
< |
#### FEDE |
389 |
< |
#txt += ' echo "which lcg-cp" \n' |
390 |
< |
#txt += ' which lcg-cp \n' |
391 |
< |
######### |
392 |
< |
txt += ' echo "lcg-cp --vo $VO --verbose -t 1200 file://$RUNTIME_AREA/$out_file gsiftp://${SE}${SE_PATH}$out_file 2>&1"\n' |
393 |
< |
txt += ' lcg-cp --vo $VO --verbose -t 1200 file://$RUNTIME_AREA/$out_file gsiftp://${SE}${SE_PATH}$out_file 2>&1\n' |
394 |
< |
txt += ' copy_exit_status=$? \n' |
395 |
< |
txt += ' fi \n' |
396 |
< |
txt += ' echo "COPY_EXIT_STATUS = $copy_exit_status"\n' |
380 |
> |
txt += ' echo "Trying to copy output file to $SE using lcg-cp"\n' |
381 |
> |
txt += ' echo "lcg-cp --vo $VO -t 1200 --verbose file://`pwd`/$out_file gsiftp://${SE}${SE_PATH}$out_file"\n' |
382 |
> |
txt += ' exitstring=`lcg-cp --vo $VO -t 1200 --verbose file://\`pwd\`/$out_file gsiftp://${SE}${SE_PATH}$out_file 2>&1`\n' |
383 |
> |
txt += ' copy_exit_status=$?\n' |
384 |
> |
txt += ' echo "COPY_EXIT_STATUS for lcg-cp = $copy_exit_status"\n' |
385 |
|
txt += ' echo "STAGE_OUT = $copy_exit_status"\n' |
398 |
– |
txt += ' exit_status=$copy_exit_status\n' |
386 |
|
txt += ' if [ $copy_exit_status -ne 0 ]; then\n' |
387 |
< |
txt += ' echo "Problems with SE = $SE"\n' |
387 |
> |
txt += ' echo "Possible problem with SE = $SE"\n' |
388 |
|
txt += ' echo "StageOutExitStatus = 198" | tee -a $RUNTIME_AREA/$repo\n' |
389 |
|
txt += ' echo "StageOutExitStatusReason = $exitstring" | tee -a $RUNTIME_AREA/$repo\n' |
390 |
+ |
txt += ' echo "lcg-cp failed, attempting srmcp"\n' |
391 |
+ |
txt += ' echo "mkdir -p $HOME/.srmconfig"\n' |
392 |
+ |
txt += ' mkdir -p $HOME/.srmconfig\n' |
393 |
+ |
txt += ' if [ $middleware == LCG ]; then\n' |
394 |
+ |
txt += ' echo "srmcp -retry_num 5 -retry_timeout 240000 file:////`pwd`/$out_file srm://${SE}:8443${SE_PATH}$out_file"\n' |
395 |
+ |
txt += ' exitstring=`srmcp -retry_num 5 -retry_timeout 240000 file:////\`pwd\`/$out_file srm://${SE}:8443${SE_PATH}$out_file 2>&1`\n' |
396 |
+ |
txt += ' elif [ $middleware == OSG ]; then\n' |
397 |
+ |
txt += ' echo "srmcp -retry_num 5 -retry_timeout 240000 -x509_user_trusted_certificates $OSG_APP/glite/etc/grid-security/certificates file:////`pwd`/$out_file srm://${SE}:8443${SE_PATH}$out_file"\n' |
398 |
+ |
txt += ' exitstring=`srmcp -retry_num 5 -retry_timeout 240000 -x509_user_trusted_certificates $OSG_APP/glite/etc/grid-security/certificates file:////\`pwd\`/$out_file srm://${SE}:8443${SE_PATH}$out_file 2>&1`\n' |
399 |
+ |
txt += ' fi \n' |
400 |
+ |
txt += ' copy_exit_status=$?\n' |
401 |
+ |
txt += ' echo "COPY_EXIT_STATUS for srm = $copy_exit_status"\n' |
402 |
+ |
txt += ' echo "STAGE_OUT = $copy_exit_status"\n' |
403 |
+ |
txt += ' if [ $copy_exit_status -ne 0 ]; then\n' |
404 |
+ |
txt += ' echo "Problems with SE = $SE"\n' |
405 |
+ |
txt += ' echo "StageOutExitStatus = 198" | tee -a $RUNTIME_AREA/$repo\n' |
406 |
+ |
txt += ' echo "StageOutExitStatusReason = $exitstring" | tee -a $RUNTIME_AREA/$repo\n' |
407 |
+ |
txt += ' echo "lcg-cp and srm failed"\n' |
408 |
+ |
txt += ' echo "If storage_path in your config file contains a ? you may need a \? instead."\n' |
409 |
+ |
txt += ' else\n' |
410 |
+ |
txt += ' echo "StageOutSE = $SE" | tee -a $RUNTIME_AREA/$repo\n' |
411 |
+ |
txt += ' echo "StageOutCatalog = " | tee -a $RUNTIME_AREA/$repo\n' |
412 |
+ |
txt += ' echo "output copied into $SE/$SE_PATH directory"\n' |
413 |
+ |
txt += ' echo "StageOutExitStatus = 0" | tee -a $RUNTIME_AREA/$repo\n' |
414 |
+ |
txt += ' echo "srmcp succeeded"\n' |
415 |
+ |
txt += ' fi\n' |
416 |
|
txt += ' else\n' |
417 |
|
txt += ' echo "StageOutSE = $SE" | tee -a $RUNTIME_AREA/$repo\n' |
418 |
|
txt += ' echo "StageOutCatalog = " | tee -a $RUNTIME_AREA/$repo\n' |
419 |
|
txt += ' echo "output copied into $SE/$SE_PATH directory"\n' |
420 |
|
txt += ' echo "StageOutExitStatus = 0" | tee -a $RUNTIME_AREA/$repo\n' |
421 |
+ |
txt += ' echo "lcg-cp succeeded"\n' |
422 |
|
txt += ' fi\n' |
423 |
|
txt += ' done\n' |
424 |
|
#txt += 'fi\n' |