source: palm/trunk/SCRIPTS/batch_scp @ 8

Last change on this file since 8 was 1, checked in by raasch, 17 years ago

Initial repository layout and content

File size: 20.9 KB
Line 
1#! /bin/ksh
2# batch_scp - Shellskript         Version:  @(#)batch_scp 1.0a     25/10/05
3
4     # Prozedur zum automatischen Transfer von Dateien mittels scp
5     #
6     # batch_scp hat 4 Argumente:
7     #         $1 = IP-Adresse des Zielrechners
8     #         $2 = zu uebertragende Datei
9     #         $3 = Verzeichnis, in das kopiert werden soll
10     #         $4 = Dateiname der Zieldatei
11
12
13     #                 ACHTUNG!!!!!!!!
14     #
15     # batch_scp hat noch folgenden grossen Mangel: wenn die Verzeichnisse
16     # auf den jeweiligen Remote-Rechnern aeltere Dateien beinhalten,
17     # die beim "ls -al" eine Jahreszahl und keine Uhrzeit (aa:bb) liefern,
18     # dann kann batch_scp die Dateinamen nicht ueberpruefen und findet
19     # z.B. bei -g die entsprechende Datei nicht!
20     #
21     #
22
23
24     # letzte Aenderung:
25     # 29/11/01 - Siggi - Entwicklungsbeginn
26     # 04/01/02 - Siggi - Version 1.0 funktionsfaehig
27     # 15/02/02 - Siggi - Verzeichnis-Listing umgestellt von "ls -al" auf "ls -1"
28     # 30/05/02 - Siggi - Abbruch mit exit 1 bei scp- oder ssh-Fehler
29     # 12/06/02 - Siggi - Version 1.0a, parent directories are also created, if
30     #                    directory on remote host does not exist
31     # 18/09/02 - Siggi - Fehlerabfragen korrigiert (waren wegen Klammerung
32     #                    unwirksam)
33     # 12/03/03 - Siggi - errfile and filelist are not stored in /tmp any more
34     #                    errors in execution of ssh does not lead
35     #                    to an abort on the NEC-system at DKRZ
36     # 01/04/03 - Siggi - small error concerning creation of catalogs removed
37     # 23/01/04 - Siggi - additional test output for scp on hurrikan
38     # 02/12/04 - Siggi - additional check of file size on remote host after scp.
39     #                    If the file sizes on local and remote host are equal,
40     #                    the scp exit status is ignored
41     # 03/12/04 - Siggi - additional checks of ssh actions independent of the
42     #                    ssh exit status
43     # 11/03/05 - Siggi - arguments are output in case of error exit
44     # 25/10/05 - Siggi - put of catalogs realized
45
46
47 
48    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
49 random=$RANDOM
50
51 absolut=false
52 append=false
53 catalog_copy=false
54 check=false
55 delete=false
56 errfile=ftpcopy.errfile.$random
57 filelist=filelist.$random
58 get=false
59 local_host=`hostname`
60 locat=normal
61 make_catalog=false
62 overwrite=false
63 print_local_filename=false
64 quote_wait=false
65 remote_user=""
66 silent=false
67 transfermode=binary
68 zyklusnr=""
69 typeset -i iii icycle maxcycle=0 wait=0
70
71    # FEHLERBEHANDLUNG
72    # BEI EXIT:
73 trap 'if [[ $locat != normal ]]
74       then
75          cat $filelist $errfile
76          rm -rf $filelist $errfile
77          printf " +++ BATCH_SCP terminated \n"
78          printf "     locat     = $locat \n"
79          printf "     arguments = $1 $2 $3 $4 \n\n"
80          exit 1
81       fi' exit
82
83
84    # BEI TERMINAL-BREAK:
85 trap 'rm -rf $filelist $errfile
86       printf " +++ BATCH_SCP terminated \n\n"
87       exit 1
88      ' 2
89
90
91    # SHELLSCRIPT-OPTIONEN EINLESEN
92 while  getopts  :aAbcCdgmnoqsu:w:  option
93 do
94   case  $option  in
95       (a)   absolut=true;;
96       (A)   append=true;;
97       (b)   transfermode=binary;;
98       (c)   catalog_copy=true;;
99       (C)   check=true;;
100       (d)   delete=true;;
101       (g)   get=true;;
102       (m)   make_catalog=true;;
103       (n)   print_local_filename=true;;  # Option ist nicht dokumentiert !
104       (o)   overwrite=true;;
105       (q)   quote_wait=true;;
106       (s)   silent=true;;
107       (u)   remote_user=$OPTARG;;
108       (w)   wait=$OPTARG;;
109       (\?)  printf "  +++ option $OPTARG unknown \n"
110             printf "  --> call: batch_scp [-aAbcCdgmnoqsuw] <IP-adress> <localfile> <remotepath> <remotefile>\n"
111             locat=parameter;exit;;
112   esac
113 done
114 shift OPTIND-1
115
116
117 
118    # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN
119 if [ "$1" = "?" ]
120 then
121   (printf "\n  *** batch_scp can be called as follows:\n"
122    printf "\n      batch_scp -a -b -d -g -o -q -s -u.. -w..  <param1> <param2> <param3> <param4>\n"
123    printf "\n      Description of available options:\n"
124    printf "\n      Option  Description                            Default-Value"
125    printf "\n        -a    Filenames are absolute. No cycle-      ---"
126    printf "\n              numbers will be determined"
127    printf "\n        -A    append to destination file             ---"
128    printf "\n        -b    use binary-modus for transfer          ASCII-modus"
129    printf "\n        -c    transfer of directory                  ---"
130    printf "\n        -C    check-Modus, no transfer               ---"
131    printf "\n        -d    file to be transferred will be         ---"
132    printf "\n              deleted after successful transfer"
133    printf "\n        -g    change of transfer direction, i.e.     ---"
134    printf "\n              file will be transferred from"
135    printf "\n              destination host"
136    printf "\n        -o    any existing file will be overwritten  ---"
137    printf "\n        -q    switch on  \"quote wait\"  on          ---"
138    printf "\n              estination host"
139    printf "\n        -s    do not display informative messages    ---"
140    printf "\n        -u    username on remote machine             <username>"
141    printf "\n        -w    waiting time in seconds, before trans- 0"
142    printf "\n              fer will be initiated"
143    printf "\n "
144    printf "\n      The positional parameters <param1> - <param4> must be provided at"
145    printf "\n      any time and have the following meaning:"
146    printf "\n        <param1>  -  IP-adress of destination host"
147    printf "\n                     or \"?\"  (creates this outline)"
148    printf "\n        <param2>  -  abs. or rel. path of file to be transferred"
149    printf "\n        <param3>  -  directory (abs.!) on destination host. Special cahracters"
150    printf "\n                     like \~ are allowed but must be quoted by \"."
151    printf "\n        <param4>  -  filename (without path!) on destination host; must not"
152    printf "\n                     be given, if option -c is used."
153    printf "\n      When using option -g, file will be copied from destination host to file"
154    printf "\n      <param2>. In this case, no overwriting is possible.") | more
155    exit
156 fi
157
158
159    # PRUEFEN, OB ALLE ARGUMENTE VORLIEGEN
160 if [[ "$1" = "" ]]
161 then
162    printf " +++ 1. argument missing \n"
163    locat=argument; exit
164 elif [[ "$2" = "" ]]
165 then
166    printf " +++ 2. argument missing \n"
167    locat=argument; exit
168 elif [[ "$3" = "" ]]
169 then
170    printf " +++ 3. argument missing \n"
171    locat=argument; exit
172 elif [[ "$4" = "" ]]
173 then
174    printf " +++ 4. argument missing \n"
175    locat=argument; exit
176 fi
177
178
179    # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN
180 if [[ -z $remote_user ]]
181 then
182
183       # PRUEFEN, OB NETRC-DATEI VORHANDEN
184    if [[ ! -f ~/.netrc ]]
185    then
186       printf " +++ option -u not given; \n"
187       printf "     getting remote-username from password file failed \n"
188       printf "     because ~/.netrc does not exist \n"
189       locat=netrc; exit
190    fi
191    grep  $1  ~/.netrc | read dum dum dum remote_user dum dum
192 fi
193
194
195    # APPEND IST NUR BEI TRANSFER EINZELNER DATEIEN OHNE UEBERSCHREIBEN
196    # ERLAUBT. GET IST DABEI EBENFALLS NICHT ERLAUBT
197 if [[ $append = true  &&  ( $get = true || $catalog_copy = true || $overwrite = true ) ]]
198 then
199    printf " +++ options -g, -c and -o are not allowed, if -A is given \n"
200    locat=parameter; exit
201 fi
202
203
204    # DATEINAME IM 4. ARGUMENT DARF NUR BEIM UEBERSCHREIBEN ODER IM ABSOLUT-
205    # MODUS PUNKTE ENTHALTEN
206 if [[ $overwrite = false  &&  $absolut = false  &&  $(echo $4 | grep -c "\.") != 0 ]]
207 then
208    printf " +++ 4th argument may only contain dots (".") , if one of the \n"
209    printf "     options -a or -o are given \n"
210    locat=argument; exit
211 fi
212
213
214    # QUOTE WAIT FUNKTIONIERT NICHT BEIM KOPIEREN GANZER VERZEICHNISSE
215 if [[ $quote_wait = true  &&  $catalog_copy = true ]]
216 then
217    printf " +++ options  -c  and  -q  must not be used simultaneously\n"
218    locat=parameter; exit
219 fi
220
221
222    # IM CHECK-MODUS WIRD SCRIPT HIER BEENDET
223 [[ $check = true ]]  &&  exit
224
225
226    # BESTIMMTE ZEIT WARTEN, BIS WEITERGEMACHT WIRD (NOETIG Z.B. BEI TRANSFER
227    # VON JOBPROTOKOLLEN AUS JOBS HERAUS)
228 sleep  $wait
229
230
231    # PRUEFEN, OB LOKALE DATEI/LOKALES VERZEICHNIS VORHANDEN BZW. NICHT VORHANDEN
232 if [[ $get = false ]]
233 then
234    if [[ $catalog_copy = false ]]
235    then
236       if [[ ! -f $2 ]]
237       then
238          printf " +++ file \"$2\" to be transferred does not exist \n"
239          locat=localfile; exit
240       fi
241    else
242       if [[ ! -d $2 ]]
243       then
244          printf " +++ directory \"$2\" to be transferred does not exist\n"
245          printf "     or is not a directory \n"
246          locat=localfile; exit
247       fi
248    fi
249 else
250    if [[ $catalog_copy = false ]]
251    then
252       if [[ -f $2 ]]
253       then
254          if [[ $overwrite = true ]]
255          then
256             rm  $2
257          else
258             printf " +++ local file \"$2\" is already existing \n"
259             locat=localfile; exit
260          fi
261       else
262
263             # PRUEFEN, OB SICH LOKALE DATEI ANLEGEN LAESST
264          local_dirname=`dirname $2`
265          if [[ ! -d $local_dirname ]]
266          then
267             printf " +++ local directory \"$local_dirname\" \n"
268             printf "     does not exist or is not a directory \n"
269             printf " +++ cannot copy file \"$3/$4\" \n"
270             printf "     from \"$1\" to \"$local_host\" \n"
271             locat=localfile; exit
272          fi
273       fi
274    else
275       if [[ -d $2  ||  -f $2 ]]
276       then
277          printf " +++ local directory \"$2\" is already existing, \n"
278          printf "     or a file with the same name exists \n"
279          locat=localfile; exit
280       fi
281    fi
282 fi
283
284
285    # VERZEICHNISLSTE DES ZIELRECHNERS ERSTELLEN
286 ssh $1 -l $remote_user "cd $3; ls -1; echo '*** list complete'" > $filelist  2>&1
287 ssh_status=$?
288
289 if [[ $ssh_status != 0 ]]
290 then
291    if [[ ! -f $filelist ]]
292    then
293       echo " local_host = $local_host   ssh_status = $ssh_status"
294       locat=ssh_failed_1; exit
295    else
296       if [[ $(grep -c "*** list complete" $filelist) = 0 ]]
297       then
298          echo " local_host = $local_host   ssh_status = $ssh_status"
299          locat=ssh_failed_2; exit
300       fi
301    fi
302 fi
303
304
305    # PRUEFEN, OB VERZEICHNIS VORHANDEN IST. WENN GANZES VERZEICHNISS ZUM
306    # ZIELRECHNER KOPIERT WERDEN SOLL, DARF DORT NOCH KEIN ENTSPRECHENDES
307    # VERZEICHNIS VORHANDEN SEIN
308 if [[ $(cat $filelist | grep -c "not found") != 0  || \
309       $(cat $filelist | grep -c "No such file or directory") != 0 ]]
310 then
311    if [[ ! ( $catalog_copy = true  &&  $get = false ) ]]
312    then
313       if [[ $make_catalog = false ]]
314       then
315          printf " +++ directory \"$3\" does not exist on destination host (\"$1\") \n"
316          locat=directory; exit
317       else
318          if [[ $silent = false ]]
319          then
320             printf "  >>> directory \"$3\" does not exist on destination host (\"$1\")"
321             printf "\n      trying to create \"$3\" \n"
322          fi
323
324          make_catalog=force
325       fi
326    fi
327 fi
328
329
330    # PRUEFEN, OB DATEI/VERZEICHNIS VORHANDEN, WENN JA, HOECHSTEN ZYKLUS
331    # ERMITTELN (BZW. IM ABSOLUT-MODUS PRUEFEN, OB DATEI VORHANDEN IST)
332    # DAS GANZE ABER NUR, WENN NICHT OVERWRITE-MODUS GEWAEHLT WURDE, DIE
333    # EVENTUELL VORHANDENE DATEI ALSO UEBERSCHRIEBEN WERDEN SOLL
334 found=false
335 if [[ ( $overwrite = false   &&  $get = false )  ||  $get = true ]]
336 then
337    while  read zeile
338    do
339       if [[ $absolut = false ]]
340       then
341          text=$(echo $zeile | cut -f1 -d".")
342          if [[ "$text" = "$4" ]]
343          then
344             found=true
345             cycle=$(echo $zeile | cut -f2 -d".")
346             if [[ "$cycle" = "$text" ]]
347             then
348                (( icycle = 0 ))
349             else
350
351                   # PRUEFEN, OB CYCLE EINE ZAHL IST
352                (( iii = 1 ))
353                character=`echo $cycle | cut -c$iii`
354                character_found=false
355                while [[ "$character" != ""  &&  $character_found = false ]]
356                do
357                   case  $character  in
358                      (0|1|2|3|4|5|6|7|8|9)  true;;
359                      (*)  character_found=true
360                   esac
361                   (( iii = iii + 1 ))
362                   character=`echo $cycle | cut -c$iii`
363                done
364
365                if [[ $character_found = false ]]
366                then
367                   (( icycle = $cycle ))
368                fi
369             fi >|$errfile 2>&1    # AUSGABE FEHLER AUF ERRFILE WENN CYCLE NICHTNUMERISCH
370
371
372                # INFORMATIVE AUSGABE, WENN DATEI NICHTNUMERISCHE EXTENSION HAT
373                # if [[ $(cat $errfile | grep -c "bad number") != 0 ]]
374             if [[ $character_found = true ]]
375             then
376                if [[ $cycle != "$5" ]]
377                then
378                   printf "  +++ file \"$text\" has non-numerical extension \".$cycle\" \n"
379                   locat=file; exit
380                else
381                   if [[ $silent = false ]]
382                   then
383                      printf "  >>> file \"$text\" has non-numerical extension \".$cycle\" \n"
384                   fi
385                fi
386             fi
387
388             if (( icycle > maxcycle ))
389             then
390                (( maxcycle = icycle ))
391             fi
392          fi
393
394       else
395
396             # IM ABSOLUT-MODUS MUSS NUR GEPRUEFT WERDEN, OB DIE DATEI
397             # VORHANDEN IST
398          [[ $4 = $zeile ]]  &&  found=true
399       fi
400
401    done <$filelist
402 fi
403
404 if [[ $found = true ]]
405 then
406    if [[ $get = false ]]
407    then
408       if [[ $absolut = false ]]
409       then
410          if [[ $append = false ]]
411          then
412             (( maxcycle = maxcycle + 1 ))
413             zyklusnr=".$maxcycle"
414          else
415             if (( maxcycle == 0 ))
416             then
417                zyklusnr=""
418             else
419                zyklusnr=".$maxcycle"
420             fi
421          fi
422       else
423          if [[ $overwrite = false ]]
424          then
425             printf "  +++ file \"$3/$4\" \n"
426             printf "      already exists on destination host (use -o, if necessary) \n"
427             locat=file; exit
428          fi
429       fi
430    else
431       if [[ $absolut = false ]]
432       then
433          if (( maxcycle == 0 ))
434          then
435             zyklusnr=""
436          else
437             zyklusnr=".$maxcycle"
438             (( maxcycle = 0 ))
439          fi
440       else
441          zyklusnr=""
442       fi
443    fi
444 else
445    zyklusnr=""
446
447       # ABBRUCH, WENN DATEI VON ZIELRECHNER GEHOLT WERDEN SOLL, DORT ABER
448       # NICHT VORHANDEN IST
449    if [[ $get = true ]]
450    then
451       printf " +++ file \"$3/$4\" \n"
452       printf "     does not exist on destination host (\"$1\") \n"
453       locat=remotefile; exit
454    fi
455 fi
456
457
458    # FALLS KATALOG ERZEUGT WIRD, DARF DIE DATEI IN KEINEM FALL EINE
459    # ZYKLUSNUMMER BESITZEN, DA SIE JA NOCh GARNICHT EXISTIEREN KANN
460 if [[ $make_catalog = force ]]
461 then
462    zyklusnr=""
463    (( maxcycle = 0 ))
464 fi
465
466 
467    # FALLS NAMENSOPTION (-n) GEWAEHLT WURDE, NUR DEN ERMITTELTEN LOKALEN
468    # DATEINAMEN DES ZIELRECHNERS AUSGEBEN UND SCRIPT BEENDEN
469 if [[ $print_local_filename = true ]]
470 then
471    printf "$4$zyklusnr\n"
472    rm -r $filelist
473    exit
474 fi
475
476
477    # FALLS 5. ARGUMENT ANGEGEBEN WURDE, WIRD DIES ALS FILE-EXTENSION
478    # HINTER DIE ZYKLUS-NUMMER GEHAENGT (FUNKTIONIERT NUR BEI KOPIEREN EINER
479    # DATEI AUF ZIELRECHNER
480 if [[ "$5" != ""  &&  $get = false ]]
481 then
482    zyklusnr=${zyklusnr}.$5
483 fi
484
485
486    # BEI VERZEICHNISTRANSFER VON ZIELRECHNER AUF LOKALEN RECHNER PRUEFEN, OB
487    # $3 AUF ZIELRECHNER WIRKLICH EIN VERZEICHNIS IST
488 if [[ $catalog_copy = true  &&  $get = true ]]
489 then
490    rm -rf $filelist
491    ssh $1 -l $remote_user "cd $3" > $filelist
492    if [[ $? != 0 ]]
493    then
494       locat=ssh_failed_3; exit
495    fi
496
497    if [[ $(cat $filelist | grep -c "Not a directory") != 0 ]]
498    then
499       printf " +++ \"$3\" on destination host is not a directory \n"
500       locat=directory; exit
501    fi
502 fi
503
504
505    # BEI KATALOGTRANSFER AUF LOKALEN RECHNER ENTSPRECHENDES VERZEICHNIS
506    # ANLEGEN
507 if [[ $catalog_copy = true ]]
508 then
509    if [[ $get = true ]]
510    then
511       mkdir $2
512    fi
513 fi
514
515
516    # Auf IBM-Rechnern (HLRN) Tilde aus Katalognamen entfernen, da scp
517    # diese nicht versteht
518 catalog_name=$3
519 if [[ $(hostname | cut -c1-4) = hreg  ||  $(hostname | cut -c1-4) = breg ]]
520 then
521    catalog_name=${catalog_name#"~/"}
522    catalog_name=${catalog_name#"~"}
523 fi
524 [[ "$catalog_name" != "" ]]  &&  catalog_name=${catalog_name}/
525
526
527    # DATEI/VERZEICHNIS PER SCP UEBERTRAGEN
528 if [[ $get = false ]]
529 then
530    if [[ $make_catalog != force ]]
531    then
532       if [[ $append = false ]]
533       then
534          if [[ $(echo $local_host | cut -c1-2) = cs ]]
535          then
536             if [[ $catalog_copy = false ]]
537             then
538                scp -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
539             else
540                scp -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr
541             fi
542          else
543             if [[ $catalog_copy = false ]]
544             then
545                scp $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
546             else
547                scp -r $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
548             fi
549          fi
550          scp_status=$?
551
552          if [[ $scp_status != 0 ]]
553          then
554                # CHECK, OB DATEIGROESSEN AUF LOKALEM UND REMOTERECHNER
555                # UEBEREINSTIMMEN
556             local_size=`ls -al  $2`
557             local_size=`echo $local_size | cut -d" " -f5`
558
559             remote_size=`ssh $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"`
560             remote_size=`echo $remote_size | cut -d" " -f5`
561
562             if [[ "$remote_size" != "$local_size" ]]
563             then
564                echo " +++ scp failed on host \"$local_host\" with exit $scp_status"
565                echo "     local size = \"$local_size\"  remote size = \"$remote_size\" "
566                date
567                locat=scp_failed; exit
568             fi
569          fi
570       else
571          scp $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random  > /dev/null
572          if [[ $? != 0 ]]
573          then
574                # CHECK, OB DATEIGROESSEN AUF LOKALEM UND REMOTERECHNER
575                # UEBEREINSTIMMEN
576             local_size=`ls -al  $2`
577             local_size=`echo $local_size | cut -d" " -f5`
578
579             remote_size=`ssh $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"`
580             remote_size=`echo $remote_size | cut -d" " -f5`
581
582             if [[ "$remote_size" != "$local_size" ]]
583             then
584                echo " +++ scp failed on host \"$local_host\" with exit $scp_status"
585                echo "     local size = \"$local_size\"  remote size = \"$remote_size\" "
586                date
587                locat=scp_for_append_failed; exit
588             fi
589          fi
590
591          rm  $filelist
592
593          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
594          if [[ $? != 0 ]]
595          then
596             if [[ ! -f $filelist ]]
597             then
598                locat=append_via_ssh_failed; exit
599             else
600                if [[ $(grep -c "*** append complete" $filelist) = 0 ]]
601                then
602                   locat=append_via_ssh_failed; exit
603                fi
604             fi
605          fi
606       fi
607    else
608       ssh $1 -l $remote_user "mkdir -p $3"
609       if [[ $? != 0 ]]
610       then
611          locat=ssh_failed_4; exit
612       fi
613       scp $2 $remote_user@$1:$catalog_name$4$zyklusnr  > /dev/null
614       if [[ $? != 0 ]]
615       then
616          locat=scp_failed; exit
617       fi
618    fi
619
620 else
621
622    if [[ $catalog_copy = false ]]
623    then
624       if [[ $quote_wait = true ]]
625       then
626
627          printf " +++ quote wait not realized with BATCH_SCP"
628          locat=unavailable_feature; exit
629
630       else
631
632          scp $remote_user@$1:$catalog_name$4$zyklusnr $2  > /dev/null
633          if [[ $? != 0 ]]
634          then
635             locat=scp_failed; exit
636          fi
637
638       fi
639    else
640
641       printf " +++ get of whole cataloges not realized with BATCH_SCP so far"
642       locat=unavailable_feature; exit
643
644#       ftp -i $1 << %END%  > /dev/null
645#$transfermode
646#cd $3
647#mget *
648#quit
649#%END%
650    fi
651 fi
652
653
654
655    # EVTL. TRANSFERIERTE DATEI AUF LOKALEM RECHNER LOESCHEN
656 if [[ $delete = true  &&  $get = false ]]
657 then
658    rm -rf  $2
659 fi
660
661
662
663    # ABSCHLUSSMELDUNG
664 if [[ $silent = false ]]
665 then
666    if (( maxcycle == 0 ))
667    then
668       if [[ $append = false ]]
669       then
670          printf "  >>> transfer successful \n"
671       else
672          printf "  >>> file was appended \n"
673       fi
674    else
675       printf "  >>> transfer successful \n"
676       if [[ $append = false ]]
677       then
678          if [[ $catalog_copy = false ]]
679          then
680             printf "      new file has cycle number $maxcycle \n"
681          else
682             printf "      new catalog has cycle number $maxcycle \n"
683          fi
684       else
685          printf "      append to cycle number $maxcycle \n"
686       fi
687    fi
688 fi
689
690 rm -rf  $filelist  $errfile
Note: See TracBrowser for help on using the repository browser.