From: Förster vom Silberwald
Subject: Note Scheme related but a question to wget and ftp servers
Date: 
Message-ID: <1190834608.094586.73320@o80g2000hse.googlegroups.com>
hello:

[there are a lot of unix experts her, so forgive me when posting up
here]

I haven't figured out yet why wget does not what I want:

First off I want to do the following with wget (downloading all the
"files in the directories" on an ftp server). One file can be
downloaded as follows:

==
- ftp ftp-name (anonymous, password)
- binary
- cd /tes/2005/
- get file.he5
- by
==


so, /tes has a lot more than just /2005 as directory: /tes/2005/, /tes/
2006/, /tes/2007/

But wh does the following wget command not work:

==
wget  -r --no-parent  -I /tes    ftp://server-name  -o log
==

Thanks,
Schneewittchen

From: Dimiter "malkia" Stanev
Subject: Re: Note Scheme related but a question to wget and ftp servers
Date: 
Message-ID: <5m00s3Far0q7U1@mid.individual.net>
Try wget -m -c -np -I /test ftp://server-name

-m (--mirror) is shortcut for -N -r -l inf --no-remove-listing

so it could be that you only need

-r -l inf

instead of just

-r

And -c is just to keep going, even if the connection is down.


F�rster vom Silberwald wrote:
> hello:
> 
> [there are a lot of unix experts her, so forgive me when posting up
> here]
> 
> I haven't figured out yet why wget does not what I want:
> 
> First off I want to do the following with wget (downloading all the
> "files in the directories" on an ftp server). One file can be
> downloaded as follows:
> 
> ==
> - ftp ftp-name (anonymous, password)
> - binary
> - cd /tes/2005/
> - get file.he5
> - by
> ==
> 
> 
> so, /tes has a lot more than just /2005 as directory: /tes/2005/, /tes/
> 2006/, /tes/2007/
> 
> But wh does the following wget command not work:
> 
> ==
> wget  -r --no-parent  -I /tes    ftp://server-name  -o log
> ==
> 
> Thanks,
> Schneewittchen
> 
From: Förster vom Silberwald
Subject: Re: Note Scheme related but a question to wget and ftp servers
Date: 
Message-ID: <1191004478.121952.268080@g4g2000hsf.googlegroups.com>
On Sep 26, 10:22 pm, "Dimiter \"malkia\" Stanev" <······@gmail.com>
wrote:
> Try wget -m -c -np -I /testftp://server-name
>
> -m (--mirror) is shortcut for -N -r -l inf --no-remove-listing
>
> so it could be that you only need
>
> -r -l inf
>
> instead of just
>
> -r
>
> And -c is just to keep going, even if the connection is down.


hello:

thanks but it does not work. however i get the directories entries at
least. I am using now this particular entries for processing it the
following way (BUT I would have been interested in how one would do it
in Scheme or Lisp without sh-scripting). I am writing the directories
(obtained by wget and included as 'index.sch') into a sh-script and
afterwards Bigloo calls sh (with the system command):

; index.sch holds the (manually edited cos wget outputs html-code)
output from wget: (define directories '("2005" "2006" "2007 etc))
==
(module get-tes
  (include "./index.sch"))


(define
  (write-ftp-sh directory-name)
  (define
    (w-s str port)
    (do ((j 0 (+ j 1)))
	((= j (string-length str)))
        (write-char (string-ref str j) port)))
  (call-with-output-file "./get-ftp.sh"
     (lambda (port)
        (w-s "user anonymous ·····@gmx.at" port)
	(write-char #\newline port)
	(w-s (string-append "cd /TES/TL2H2ON.002/" directory-name) port)
	(write-char #\newline port)
	(w-s "prompt" port)
	(write-char #\newline port)
	(w-s "binary" port)
	(write-char #\newline port)
	(w-s "mget *.he5*" port)
	(write-char #\newline port)
	(w-s "by" port))))


(define
   (get-data directories ftp-server)
   (map (lambda (x)
           (print "processing: " x )
           (write-ftp-sh x)
           ; connecting to the server and passing forward the created
sh-scrip
	   (system (string-append "ftp -n " ftp-server " < get-ftp.sh"))
	   (system (string-append "mkdir /data/T.002/" x))
	   (system (string-append "cp /scratch/T.002/*.he5* /data/T.002/" x))
	   (system "rm ./get-ftp.sh")
           (system "rm ./*.he5*"))
       directories))

(get-data directories "ftp.server")
==


Thanks,
Schneewittchen