| 1. |
Solve : Batch File Using Wget? |
|
Answer» I'm trying to write a basic batch file that will download files from an ftp site that contain a date/time stamp, but I'm having difficulties. Why not just download all the files in a directory and then select the ones that match the time stamp you want?Thanks for the replies. I could do what Geek suggested and download all files on the FTP site and just KEEP the current files, based on the datestamp, but I'm sure there is an easier way of passing the date/time stamp into the filename. Foxidrive, you are right that the files from the ftp site have the date/time stamp in their name, so I only wanted to download the current ones. A sample URL is below: ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.2013012400/ So, how can I put the time/date stamp (2013012400) into the wget command: wget ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.%MODELTIME%/Another approach might be to use WGET to get a file listing of what is in the ftp directory: Code: [Select]wget ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/ This will produce an index.html file. You could try using batch, but a better solution would be VBScript or Powershell (both available on your machine) to parse the index data and find the most recent files. Next step would be to use WGET again, this time with specific file names. Just a thought. |
|