Linux – The –reject feature in wget doesn’t seem to work

linuxmirroringwget

I am trying to mirror most of a ftp sever using wget.

This particular sever keeps old copies of the data files in a folder called 'backup' inside every subfolder. e.g. '/MaffiaOffShore/backup' '/VeryVeryDodgy/backup', which I don't want but my attempts at using –reject 'backup' and using –exclude-directories 'backup' and various other combinations, all have the same result, the whole sever is mirrored, including the backup folder.

Is this a bug or am I missing something?

Best Answer

The exclude directories option is:

--exclude-directories=List

not --exclude-directory as you have included in your question

from the wget man page

-X list
--exclude-directories=list
   Specify a comma-separated list of directories you wish to exclude
   from download (@pxref{Directory-Based Limits} for more details.)
   Elements of list may contain wildcards.
Related Topic