I have a web directory where I store some config files. I’d like to use wget to pull those files down and maintain their current structure. For instance, the remote directory looks like:
http://mysite.com/configs/.vim/
.vim holds multiple files and directories. I want to replicate that on the client using wget. Can’t seem to find the right combo of wget flags to get this done. Any ideas?
You have to pass the
-np/--no-parentoption towget(in addition to-r/--recursive, of course), otherwise it will follow the link in the directory index on my site to the parent directory. So the command would look like this:To avoid downloading the auto-generated
index.htmlfiles, use the-R/--rejectoption: