Changeset 693 for palm/trunk/SCRIPTS/batch_scp
- Timestamp:
- Mar 8, 2011 8:27:49 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/batch_scp
r306 r693 45 45 # 25/10/05 - Siggi - put of catalogs realized 46 46 # 27/04/09 - Marcus- use option -p for all scp calls 47 # 08/03/11 - Siggi - adjustments for ibmkisti: this machine allows 48 # outgoing ssh/scp connections only from the 49 # interactive nodes (gaiad). All ssh/scp traffic is 50 # done via this interactive node. 47 51 48 52 … … 60 64 get=false 61 65 local_host=`hostname` 66 local_user=$USER 67 local_wdir=`pwd` 62 68 locat=normal 63 69 make_catalog=false … … 286 292 287 293 # VERZEICHNISLSTE DES ZIELRECHNERS ERSTELLEN 288 ssh $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist 2>&1 294 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 295 then 296 ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3; ls -1; echo '*** list complete'\" " > $filelist 2>&1 297 else 298 ssh $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist 2>&1 299 fi 289 300 ssh_status=$? 290 301 … … 491 502 then 492 503 rm -rf $filelist 493 ssh $1 -l $remote_user "cd $3" > $filelist 504 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 505 then 506 ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3\" " > $filelist 507 else 508 ssh $1 -l $remote_user "cd $3" > $filelist 509 fi 494 510 if [[ $? != 0 ]] 495 511 then … … 542 558 scp -p -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr 543 559 fi 560 elif [[ $(echo $local_host | cut -c1-4) = gaia ]] 561 then 562 if [[ $catalog_copy = false ]] 563 then 564 ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 565 else 566 ssh $local_user@gaiad "cd $local_wdir; scp -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 567 fi 544 568 else 545 569 if [[ $catalog_copy = false ]] … … 559 583 local_size=`echo $local_size | cut -d" " -f5` 560 584 561 remote_size=`ssh $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"` 585 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 586 then 587 remote_size=`ssh $local_user@gaiad "ssh $1 -l $remote_user \"ls -al $catalog_name$4$zyklusnr\" "` 588 else 589 remote_size=`ssh $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"` 590 fi 562 591 remote_size=`echo $remote_size | cut -d" " -f5` 563 592 … … 571 600 fi 572 601 else 573 scp -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random > /dev/null 602 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 603 then 604 ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random" > /dev/null 605 else 606 scp -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random > /dev/null 607 fi 574 608 if [[ $? != 0 ]] 575 609 then … … 579 613 local_size=`echo $local_size | cut -d" " -f5` 580 614 581 remote_size=`ssh $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"` 615 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 616 then 617 remote_size=`ssh $local_user@gaiad "ssh $1 -l $remote_user \"ls -al ${catalog_name}batch_scp_append_file.$random\" "` 618 else 619 remote_size=`ssh $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"` 620 fi 582 621 remote_size=`echo $remote_size | cut -d" " -f5` 583 622 … … 593 632 rm $filelist 594 633 595 ssh $1 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist 634 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 635 then 636 ssh $local_user@gaiad "ssh $1 -l $remote_user \"cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'\" " > $filelist 637 else 638 ssh $1 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist 639 fi 596 640 if [[ $? != 0 ]] 597 641 then … … 608 652 fi 609 653 else 610 ssh $1 -l $remote_user "mkdir -p $3" 654 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 655 then 656 ssh $local_user@gaiad "ssh $1 -l $remote_user \"mkdir -p $3\" " 657 else 658 ssh $1 -l $remote_user "mkdir -p $3" 659 fi 611 660 if [[ $? != 0 ]] 612 661 then 613 662 locat=ssh_failed_4; exit 614 663 fi 615 scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 664 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 665 then 666 ssh $local_user@gaiad "cd $local_wdir; scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 667 else 668 scp -p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 669 fi 616 670 if [[ $? != 0 ]] 617 671 then … … 632 686 else 633 687 634 scp -p $remote_user@$1:$catalog_name$4$zyklusnr $2 > /dev/null 688 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 689 then 690 ssh $local_user@gaiad "cd $local_wdir; scp -p $remote_user@$1:$catalog_name$4$zyklusnr $2" > /dev/null 691 else 692 scp -p $remote_user@$1:$catalog_name$4$zyklusnr $2 > /dev/null 693 fi 635 694 if [[ $? != 0 ]] 636 695 then
Note: See TracChangeset
for help on using the changeset viewer.