Changeset 82 for palm/trunk/SCRIPTS/subjob
- Timestamp:
- Apr 16, 2007 3:40:52 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/subjob
r69 r82 1 1 #!/bin/ksh 2 # subjob - Plot-Shellskript Version: @(#)SUBJOB 1.0 13/02/072 # subjob - Plot-Shellskript Version: @(#)SUBJOB 1.0 3 3 # $Id: subjob 54 2007-03-08 00:00:02Z raasch $ 4 4 … … 81 81 # 13/02/07 - Siggi - hpmuk releated code removed 82 82 # 01/03/07 - Siggi - adjustments for RIAM machines gate and NEC-SX8 (n-sx) 83 # 12/04/07 - Siggi - option -f (filetransfer protocol) removed, scp only 83 84 84 85 85 86 # VARIABLENVEREINBARUNGEN + DEFAULTWERTE 86 87 delete_dayfile=false 87 filetransfer_protocol=scp88 88 locat=normal 89 89 no_default_queue=none … … 180 180 181 181 # PROZEDUROPTIONEN EINLESEN 182 while getopts :c:dD f:h:m:n:N:O:q:t:T:u:vX: option182 while getopts :c:dDh:m:n:N:O:q:t:T:u:vX: option 183 183 do 184 184 case $option in … … 186 186 (d) delete_dayfile=true;; 187 187 (D) no_submit=true;; 188 (f) filetransfer_protocol=$OPTARG;;189 188 (h) remote_host=$OPTARG;; 190 189 (m) memory=$OPTARG;; … … 218 217 printf "\n -d no job-protocol will be created ---" 219 218 printf "\n -D only the job-file will be created ---" 220 printf "\n -f filetransfer protocol scp"221 219 printf "\n -h execution host, available hosts: $remote_host" 222 220 printf "\n ibm, ibmb, ibmh, ibms, ibmy, lcmuk," … … 897 895 then 898 896 [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." 899 if [[ $filetransfer_protocol = scp ]] 900 then 901 if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" 902 then 903 job_catalog_save=$job_catalog 904 job_catalog=job_queue 905 elif [[ $remote_host = nech ]] 906 then 907 job_catalog_save=$job_catalog 908 job_catalog=/hpf/b/${remote_user}/job_queue 909 fi 910 if [[ $local_host = decalpha ]] 911 then 912 # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE 913 # PASSWORT AB 914 /bin/scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 915 elif [[ $remote_host = nech ]] 916 then 917 # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ 918 # TRANSFERIERT WERDEN 919 scp $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost 920 else 921 scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 922 fi 923 if [[ $? = 1 ]] 924 then 925 locat=scp; exit 926 fi 927 if [[ $remote_host = ibms ]] 928 then 929 job_catalog=$job_catalog_save 930 fi 897 if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" 898 then 899 job_catalog_save=$job_catalog 900 job_catalog=job_queue 901 elif [[ $remote_host = nech ]] 902 then 903 job_catalog_save=$job_catalog 904 job_catalog=/hpf/b/${remote_user}/job_queue 905 fi 906 if [[ $local_host = decalpha ]] 907 then 908 # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE 909 # PASSWORT AB 910 /bin/scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 911 elif [[ $remote_host = nech ]] 912 then 913 # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ 914 # TRANSFERIERT WERDEN 915 scp $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost 931 916 else 932 ftpcopy -s -o $remote_addres $job_to_send "$job_catalog" $job_on_remhost 933 if [[ $? = 1 ]] 934 then 935 locat=ftpcopy; exit 936 fi 917 scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 918 fi 919 if [[ $? = 1 ]] 920 then 921 locat=scp; exit 922 fi 923 if [[ $remote_host = ibms ]] 924 then 925 job_catalog=$job_catalog_save 937 926 fi 938 927 [[ $verify = true ]] && printf "\n >>> finished\n" … … 948 937 then 949 938 [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" 950 if [[ $filetransfer_protocol = scp ]] 951 then 952 if [[ $remote_host != lctit ]] 953 then 954 ssh $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" 955 else 956 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS 957 # MIT SSH, DESHALB AUFRUF PER PIPE 958 # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR 959 print "cd $job_catalog; chmod u+x $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 960 echo "first try" > send_protocol 961 while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]] 962 do 963 if [[ $(cat send_protocol | grep -c "first try") = 1 ]] 964 then 965 printf "\n trying to submit job to TIT cluster..." 966 else 967 printf "\n +++ failed ... trying to submit again ..." 968 fi 969 print "cd $job_catalog; $submcom $job_on_remhost" | ssh $remote_addres -l $remote_user > send_protocol 2>&1 970 cat send_protocol 971 done 972 sleep 10 973 print "cd $job_catalog; rm $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 974 echo "$submcom $job_on_remhost" 975 rm send_protocol 976 fi 939 if [[ $remote_host != lctit ]] 940 then 941 ssh $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" 977 942 else 978 if [[ $remote_host = ibms ]] 979 then 980 password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'` 981 echo "echo \"$remote_user\" " > telnet_script 982 echo "sleep 5" >> telnet_script 983 echo "echo \"$password\" " >> telnet_script 984 echo "sleep 10" >> telnet_script 985 echo "echo \"\" " >> telnet_script 986 echo "sleep 2" >> telnet_script 987 echo "echo \"cd $job_catalog; $submcom $job_on_remhost; rm -rf $job_on_remhost\" " >> telnet_script 988 echo "sleep 10" >> telnet_script 989 echo "echo \"exit\" " >> telnet_script 990 991 chmod u+x telnet_script 992 telnet_script | telnet $remote_addres 2>&1 | grep "llsubmit:" 993 rm telnet_script 994 elif [[ $remote_host = t3es ]] 995 then 996 password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'` 997 echo "printf \"$remote_user\\\n\" " > telnet_script 998 echo "sleep 10" >> telnet_script 999 echo "printf \"$password\\\n\" " >> telnet_script 1000 echo "sleep 10" >> telnet_script 1001 echo "printf \"\\\n\" " >> telnet_script 1002 echo "sleep 5" >> telnet_script 1003 echo "printf \"\\\n\" " >> telnet_script 1004 echo "sleep 5" >> telnet_script 1005 echo "printf \"cd $job_catalog; $submcom $job_on_remhost; rm -f $job_on_remhost\\\n\" " >> telnet_script 1006 echo "sleep 10" >> telnet_script 1007 echo "printf \"exit\\\n\" " >> telnet_script 1008 1009 chmod u+x telnet_script 1010 cat telnet_script 1011 telnet_script | telnet $remote_addres | grep $remote_user 1012 rm telnet_script 1013 else 1014 remcom.x $remote_addres "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" 1015 fi 1016 fi 943 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS 944 # MIT SSH, DESHALB AUFRUF PER PIPE 945 # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR 946 print "cd $job_catalog; chmod u+x $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 947 echo "first try" > send_protocol 948 while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]] 949 do 950 if [[ $(cat send_protocol | grep -c "first try") = 1 ]] 951 then 952 printf "\n trying to submit job to TIT cluster..." 953 else 954 printf "\n +++ failed ... trying to submit again ..." 955 fi 956 print "cd $job_catalog; $submcom $job_on_remhost" | ssh $remote_addres -l $remote_user > send_protocol 2>&1 957 cat send_protocol 958 done 959 sleep 10 960 print "cd $job_catalog; rm $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 961 echo "$submcom $job_on_remhost" 962 rm send_protocol 963 fi 964 1017 965 [[ $verify = true ]] && printf " >>> o.k.\n" 1018 966 else
Note: See TracChangeset
for help on using the changeset viewer.