Quantcast
Viewing all articles
Browse latest Browse all 1994

Cobian Reflector • Downloading files from a NON-ftp website

This is a small guide using a bat file to download a file from a non-ftp website.
Example used : Map image from a game's web map and date stamp the actual filename and subfolder.
I got a much longer explanation of what I use it for on the games moding forums https://forum.wurm-unlimited.net/viewto ... f=35&t=162

Create a Bat file and give it a name you can remember (notepad and file save as works for this)

Add the following lines replacing the parts between {} brackets

Code:

@echo offfor /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"set "folderstamp=%DD% %MM% %YYYY%"set "datestamp=%DD%%MM%%YYYY%"@echo onmd "{full folder using \ not /}\%folderstamp%"cd "{full folder using \ not /}\%folderstamp%"curl {web link to file} --output %datestamp%{filename with extension} --ssl-no-revoke{add more curls for each file}cd..
The 1st part between echo on and off is just for the date stamps
I use a spaced date for the Folder and no spaces datestamp for the file.
For the folder use the full name like C:\Webbackups\Wurm\Maps\ and make sure the folder exist
md makes the date sub folder
cd opens the sub folder for use
Curl stands for Copy url. the--output allows use to date stamp and rename the file. JUST REMEMBER THE EXTENSIONS MUST BE THE SAME.
the --sll-no revoke isn't always needed but its better to have it and not need it. (ignores old certificates and other sll issues)
and the cd.. just closes out of the subfolder. It ain't needed but it just looks neater.

Run the bat to see if it works. it is normal for it to pop up an old looking dos window.
If it doesn`t add pause to the bottom to see what error it gives. Once it works remove the pause.

You can then add it to Cobian
In Cobain click the big + (5th icon)
Give the task a name and select Dummy tasks.
In schedule choose how often and a time. (Make sure your PC and internet is on at this time)
Then in Events , in the pre-backup events click Add -> execute.
In the explorer change the file type to all and go find the .bat file you made.
If done correctly it should list the folder and file in the pre-backup events.
Click Ok
Click the > (2nd button with the task selected) to run the tasks to test it.
It should open the exact same “dos” window as the downloader step

Example of how the bat should look.

Code:

@echo offfor /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"set "folderstamp=%DD% %MM% %YYYY%"set "datestamp=%DD%%MM%%YYYY%"@echo onmd "C:\Users\Axeblade346\Pictures\WURM\Wurm Maps\%folderstamp%"cd "C:\Users\Axeblade346\Pictures\WURM\Wurm Maps\%folderstamp%"curl https://kangawu.com.au/map_kw/map-terrain.png --output %datestamp%KWFLAT.png --ssl-no-revokecurl https://kangawu.com.au/map_kw/map-topographic.png --output %datestamp%KWTOPO.png --ssl-no-revokecurl https://kangawu.com.au/map_kw/map-isometric.png --output %datestamp%KWISO.png --ssl-no-revokecurl https://kangawu.com.au/map_tw/map-terrain.png --output %datestamp%TWFLAT.png --ssl-no-revokecurl https://kangawu.com.au/map_tw/map-topographic.png --output %datestamp%TWTOPO.png --ssl-no-revokecurl https://kangawu.com.au/map_tw/map-isometric.png --output %datestamp%TWISO.png --ssl-no-revokecd..

Statistics: Posted by axeblade346 — 01 Aug 2022, 17:11 — Replies 1 — Views 8



Viewing all articles
Browse latest Browse all 1994

Trending Articles