tags:

views:

565

answers:

2

I need files to be downloaded to /tmp/cron_test/. My wget code is

wget --random-wait -r -p -nd -e robots=off -A".pdf" -U mozilla http://math.stanford.edu/undergrad/

So is there some parameter to specify the directory?

+3  A: 

From the manual page:

-P prefix
--directory-prefix=prefix
           Set directory prefix to prefix.  The directory prefix is the
           directory where all other files and sub-directories will be
           saved to, i.e. the top of the retrieval tree.  The default
           is . (the current directory).

So you need to add -P /tmp/cron_test/ to your command.

RichieHindle
-P is the shorter form for --directory-prefix
nik
@nik: Oops - missed a line off my cut-n-paste. 8-) Now fixed.
RichieHindle
A: 

Is the option -P path_prefix or --directory-prefix=path_prefix what you are looking for ?

-P prefix
--directory-prefix=prefix
Set directory prefix to prefix. The directory prefix is the directory where all other files and subdirectories will be saved to, i.e. the top of the retrieval tree. The default is . (the current directory).

See the manpage

EDIT: well, Ritchie, you answered quicker !

ThibThib