简体   繁体   中英

Howto created trimmed directory tree while using wget for ftp download

Am using wget for download files from ftp.

Ftp folder have name /var/www/html/

Inside this folder is located tree of folders & files, ~20 levels.

Am trying make ftp download (have no ssh access), of this all with wget.

wget -- recursive -nv --user user --password pass ftp://site.tld/var/www/folder/

This one command runs Ok. But it creates an folder structure.

~/back/site.tld/var/www/html/my-files-and-folders-here

Question: Is any possibility - to say wget, not create ~/site.tld/var/www/html/ but make all tree, in current folder?
ie ~/back/my-files-want-here/ Ie - to trim/cut certain path?

Thanks

Look for --no-host-directories and --cut-dirs in the manpage.

This should work like expected (maybe you have to increase/decrease cut-dirs ):

wget --recursive --no-verbose --no-host-directories --cut-dirs=3 --user user --password password ftp://site.tld/var/folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM