Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Note Scheme related but a question to wget and ftp servers

0 views
Skip to first unread message

Förster vom Silberwald

unread,
Sep 26, 2007, 3:23:28 PM9/26/07
to
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

Peter Ilberg

unread,
Sep 26, 2007, 4:16:14 PM9/26/07
to

On Wed, 26 Sep 2007, Förster vom Silberwald wrote:
> ==
> wget -r --no-parent -I /tes ftp://server-name -o log
> ==

I haven't tested it, but I would try:

wget -r --no-parent ftp://server-name/tes

--- Peter

Dimiter "malkia" Stanev

unread,
Sep 26, 2007, 5:22:09 PM9/26/07
to
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

unread,
Sep 28, 2007, 2:34:38 PM9/28/07
to
On Sep 26, 10:22 pm, "Dimiter \"malkia\" Stanev" <mal...@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 em...@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

0 new messages