开发者

updating data from different URL using wget

What's the best way of updating data files from a website that has moved on to a new domain, with changes in their folder structure.

The old URL for example is http://folder.old-domain.com while the new URL is http://new-domain.com/directory1/directory2. My data is stored locally in ~/Data_Backup/folder.old-domain.com folder.

Data was originally downloaded using:

$ wget -S -t 0 -c --mirror –w 2 –k http://folder.old-domain.com

I was thinking of using mv to rename the old fold开发者_如何学Pythoner to follow the new URL pattern, but is there a better way of doing this?

Will this work? I'm not particular with the directory structure. What's important is to update the contents of the target folder (and its sub-folders.)

$ wget -S -t 0 -c -m –w 2 –k -N -np -P ~/Data_Backup/folder.old-domain.com http://new-domain.com/directory/directory

Thanks in advance.


Got it!

I need to add the following options: -nH --cut-dirs=2

and now it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜