Wget: download files to specific directory

I have been trying to get wget to download all files to a specific directory. I tried the -O option but I get

/home/user/xml/: Is a directory

This is what I have so far

wget -m --user=user --password=pass -r -l1 --no-parent -A.rss ftp://localhost/public_html/

I need to download all .rss files from ftp to a specific directory on my secondary server.

2 Answers

use -P option.

wget -P /home/user/directory_you_want http:url_you_are_downloading_from

See more at : Stackoverflow page

0

The -P option downloaded all the files to the specific directory however it created 2 new directories inside the target directory.

So the files went into /home/user/xml/192.168.1.1/public_html/

So I tried it with the -P option and the -nd option and it worked the way I needed it to.

The final code looks like this

wget -m -nd --user=user --password=password -r -l1 --no-parent -A.rss ftp://localhost/public_html/ -P /home/user/Desktop/xml/

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like