How to change wget download directory?

i have a cron that mirrors a site periodically

wget -r -nc  --passive-ftp ftp://user:pass@123.456.789.0

i want to download this into a directory called /files
but when I do this, it always create a new directory called "123.456.789.0" (the hostname)
it puts it into /files/123.456.789.0

but I don't know how to prevent it from automatically creating the directory of the hostname, any ideas?

i just want it to stop automatically creating a directory called the hostname and putting everything there

I've tried setting a prefix but then it still creates a directory with the name of the hostname
like /files/prefix/123.456.789.0
how do I prevent it from generating the hostname directory?

thanks!

Read more about -O switch of wget in the man pages.

wget -O /path/to/output/file <url>

it doesnt look like what im looking for
im not trying to download a file but everything on the remote host recursively

Maybe

1 Like