Changeset 1094 for palm/trunk/SCRIPTS/batch_scp
- Timestamp:
- Feb 3, 2013 1:52:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/batch_scp
r1091 r1094 22 22 # Current revisions: 23 23 # ------------------ 24 # 24 # new option -P for explicit setting of ssh/scp port 25 25 # 26 26 # Former revisions: … … 104 104 105 105 # SHELLSCRIPT-OPTIONEN EINLESEN 106 while getopts :aAbcCdgmno qsu:w: option106 while getopts :aAbcCdgmnoP:qsu:w: option 107 107 do 108 108 case $option in … … 117 117 (n) print_local_filename=true;; # Option ist nicht dokumentiert ! 118 118 (o) overwrite=true;; 119 (P) scp_port=$OPTARG;; 119 120 (q) quote_wait=true;; 120 121 (s) silent=true;; … … 243 244 244 245 246 # Set port number option for calls of ssh/scp, subjob and batch_scp scripts 247 if [[ "$scp_port" != "" ]] 248 then 249 PORTOPT="-P $scp_port" 250 SSH_PORTOPT="-p $scp_port" 251 fi 252 253 245 254 # PRUEFEN, OB LOKALE DATEI/LOKALES VERZEICHNIS VORHANDEN BZW. NICHT VORHANDEN 246 255 if [[ $get = false ]] … … 300 309 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 301 310 then 302 ssh $ local_user@gaiad "ssh$1 -l $remote_user \"cd $3; ls -1; echo '*** list complete'\" " > $filelist 2>&1311 ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"cd $3; ls -1; echo '*** list complete'\" " > $filelist 2>&1 303 312 else 304 ssh -p 22$1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist 2>&1313 ssh $SSH_PORTOPT $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist 2>&1 305 314 fi 306 315 ssh_status=$? … … 510 519 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 511 520 then 512 ssh $ local_user@gaiad "ssh $1 -l $remote_user \"cd $3\" " > $filelist521 ssh $SSH_PORTOPT $local_user@gaiad "ssh $1 -l $remote_user \"cd $3\" " > $filelist 513 522 else 514 ssh $ 1 -p 22-l $remote_user "cd $3" > $filelist523 ssh $SSH_PORTOPT $1 -l $remote_user "cd $3" > $filelist 515 524 fi 516 525 if [[ $? != 0 ]] … … 560 569 if [[ $catalog_copy = false ]] 561 570 then 562 scp -p -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr571 scp $PORTOPT -p -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr 563 572 else 564 scp -p -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr573 scp $PORTOPT -p -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr 565 574 fi 566 575 elif [[ $(echo $local_host | cut -c1-4) = gaia ]] … … 568 577 if [[ $catalog_copy = false ]] 569 578 then 570 ssh $ local_user@gaiad "cd $local_wdir; scp-p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null579 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 571 580 else 572 ssh $ local_user@gaiad "cd $local_wdir; scp-p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null581 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 573 582 fi 574 583 else 575 584 if [[ $catalog_copy = false ]] 576 585 then 577 scp -P 22-p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null586 scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 578 587 else 579 scp -P 22-p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null588 scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 580 589 fi 581 590 fi … … 591 600 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 592 601 then 593 remote_size=`ssh $ local_user@gaiad "ssh$1 -l $remote_user \"ls -al $catalog_name$4$zyklusnr\" "`602 remote_size=`ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"ls -al $catalog_name$4$zyklusnr\" "` 594 603 else 595 remote_size=`ssh $ 1 -p 22-l $remote_user "ls -al $catalog_name$4$zyklusnr"`604 remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"` 596 605 fi 597 606 remote_size=`echo $remote_size | cut -d" " -f5` … … 608 617 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 609 618 then 610 ssh $ local_user@gaiad "cd $local_wdir; scp-p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random" > /dev/null619 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random" > /dev/null 611 620 else 612 scp -P 22-p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random > /dev/null621 scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random > /dev/null 613 622 fi 614 623 if [[ $? != 0 ]] … … 621 630 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 622 631 then 623 remote_size=`ssh $ local_user@gaiad "ssh$1 -l $remote_user \"ls -al ${catalog_name}batch_scp_append_file.$random\" "`632 remote_size=`ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"ls -al ${catalog_name}batch_scp_append_file.$random\" "` 624 633 else 625 remote_size=`ssh $ 1 -p 22-l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`634 remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"` 626 635 fi 627 636 remote_size=`echo $remote_size | cut -d" " -f5` … … 640 649 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 641 650 then 642 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'\" " > $filelist651 ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'\" " > $filelist 643 652 else 644 ssh $ 1 -p 22-l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist653 ssh $SSH_PORTOPT $1 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist 645 654 fi 646 655 if [[ $? != 0 ]] … … 660 669 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 661 670 then 662 ssh $ local_user@gaiad "ssh $1 -l $remote_user \"mkdir -p $3\" "663 else 664 ssh $ 1 -p 22-l $remote_user "mkdir -p $3"671 ssh $SSH_PORTOPT $local_user@gaiad "ssh $1 -l $remote_user \"mkdir -p $3\" " 672 else 673 ssh $SSH_PORTOPT $1 -l $remote_user "mkdir -p $3" 665 674 fi 666 675 if [[ $? != 0 ]] … … 670 679 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 671 680 then 672 ssh $ local_user@gaiad "cd $local_wdir; scp-p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null673 else 674 scp -P 22-p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null681 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 682 else 683 scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 675 684 fi 676 685 if [[ $? != 0 ]] … … 694 703 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 695 704 then 696 ssh $ local_user@gaiad "cd $local_wdir; scp-p $remote_user@$1:$catalog_name$4$zyklusnr $2" > /dev/null705 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $remote_user@$1:$catalog_name$4$zyklusnr $2" > /dev/null 697 706 else 698 scp -P 22-p $remote_user@$1:$catalog_name$4$zyklusnr $2 > /dev/null707 scp $PORTOPT -p $remote_user@$1:$catalog_name$4$zyklusnr $2 > /dev/null 699 708 fi 700 709 if [[ $? != 0 ]]
Note: See TracChangeset
for help on using the changeset viewer.