Page 1 of 1

External program

Posted: Sat 16 Nov 2019 4:14 pm
by PaulMy
I currently run Cumulusutils in the External program Daily program with the parameter as pwsFWI and this works great www.komokaweather.com/komokaweather-ca/wxFWI.php
In the settings this appears to be for a single run/parameter. How can I run this with additional parameters - i.e. maps so that this can also be updated once a day www.komokaweather.com/komokaweather-ca/wxMap.php

Thanks,
Paul

Re: External program

Posted: Sat 16 Nov 2019 5:56 pm
by meteosangonera
PaulMy wrote: Sat 16 Nov 2019 4:14 pm I currently run Cumulusutils in the External program Daily program with the parameter as pwsFWI and this works great www.komokaweather.com/komokaweather-ca/wxFWI.php
In the settings this appears to be for a single run/parameter. How can I run this with additional parameters - i.e. maps so that this can also be updated once a day www.komokaweather.com/komokaweather-ca/wxMap.php

Thanks,
Paul
You can use multiple parameter at the same time. You have to let a space between each parameter.

Re: External program

Posted: Sat 16 Nov 2019 7:05 pm
by PaulMy
Thank you, I will add the other parameters.

Enjoy,
Paul

Re: External program

Posted: Tue 19 Nov 2019 3:07 am
by Phil23
I only have one external program run at end of day.

C:\CumulusMX\Scripts\DayEnd.bat

Then do all the stuff I want in that batch file.

Code: Select all

@echo off
echo Waiting a few seconds for End of Day to complete.

ping localhost -n 5 > nul

copy "\\WEATHER-PC\Cumulus\data\dayfile.txt" + "\\WEATHER-PC\CumulusMX\data\dayfile.txt" "\\WEATHER-PC\CumulusMX\Scripts\dayfile-merged.txt" /b /y

cd \cumulusmx
cumulusutils Top10 pwsFWI SysInfo Graphs MapsOn

ftp -s:"\\WEATHER-PC\CumulusMX\Scripts\ftp.txt"

Ping localhost -n 5 > nul
CD\

The FTP in Windows is fed by the command file ftp.txt

Code: Select all

open weather.inverellit.com
Username
Password
cd /public_html/weather/historic
put \\WEATHER-PC\CumulusMX\Scripts\dayfile-merged.txt dayfile.txt
cd /public_html/weather
put \\WEATHER-PC\CumulusMX\utils\pwsFWI.txt pwsFWI.txt
put \\WEATHER-PC\CumulusMX\utils\top10Table.txt top10Table.txt
put \\WEATHER-PC\CumulusMX\utils\graphs.txt graphs.txt
put \\WEATHER-PC\CumulusMX\utils\maps.txt maps.txt
put \\WEATHER-PC\CumulusMX\utils\pwsFWIanalyse.csv pwsFWIanalyse.csv
quit
Lets me run more than one command & a bit easier to manage.

Phil.

Re: External program

Posted: Tue 19 Nov 2019 5:56 am
by PaulMy
I've tried the multi parameters and that works as each of pwsFWI, graphs, MapOn, SysInfo and Top10 were executed and the results files placed in the \utils folder, thanks for that suggestion.
However the timing of the external program execution and the End of Day FTP of the files are not in sync so the FTP was done before the cumulusutils.exe were executed causing the previous days files to be FTP.

I've looked at Phil's batch file which he indicates has a delay to wait a few seconds, but so far beyond my understanding how to put that together and use it.
I could have the files FTP at the Cumulus 5 min interval (all except maps) instead at end of day but that would be overkill.


Edit: just thought of a way, instead of CumulusMX Extra web files to FTP at End of day, use Cumulus Toolbox to FTP at a time after 12:00 am.

Enjoy,
Paul

Re: External program

Posted: Wed 20 Nov 2019 6:05 am
by Phil23
PaulMy wrote: Tue 19 Nov 2019 5:56 am I've looked at Phil's batch file which he indicates has a delay to wait a few seconds, but so far beyond my understanding how to put that together and use it.
It's pretty simple really.

Code: Select all

@echo off
That just stops the commands showing in the dos box.

Code: Select all

echo Waiting a few seconds for End of Day to complete.
Puts that message in the dos box. Like print...

Code: Select all

ping localhost -n 5 > nul
Just makes the PC ping it's self to create the delay

Code: Select all

cd \cumulusmx
cumulusutils Top10 pwsFWI SysInfo Graphs MapsOn
Changes to the MX folder & runs the cumulusutils

Code: Select all

ftp -s:"\\WEATHER-PC\CumulusMX\Scripts\ftp.txt"
Runs the windows FTP command with the commands in the FTP.txt file shown above.

You don't need a lot of the rest & you can see in my FTP.txt file above the list of files I am transferring.

Re: External program

Posted: Wed 20 Nov 2019 8:37 am
by HansR
What happened to the sleep command? eg:

Code: Select all

Sleep 10
for a 10 second delay?
Gives more control and precision.

Re: External program

Posted: Wed 20 Nov 2019 4:46 pm
by Phil23
HansR wrote: Wed 20 Nov 2019 8:37 am What happened to the sleep command?
Hmmm
The simple things we forget.....

That one must have long slipped out of my DOS command memory bank.

I do recall though that I had left the > NUL off initially for feedback during debugging.

Re: External program

Posted: Wed 20 Nov 2019 7:58 pm
by Phil23
Just tried to refresh my brain a bit on a few dos commands.

Appears Sleep does not exist as an internal or default installed external command.

Apparently it was distributed in some Win Resource kits.

Win 7 & above include Timeout.

Timeout /t 10 [/nobreak]

It can be aborted with CTRL-C & in that case it will return an Errorlevel=1

Useful for jumping over bits.

Phil.

Re: External program

Posted: Wed 20 Nov 2019 9:35 pm
by HansR
Mmm... Must have been win10 too long :)

Re: External program

Posted: Wed 20 Nov 2019 9:52 pm
by PaulMy
Using CumulusMX External programs Daily program works great with the 5 parameters. Cumulus Toolbox with FTP at shortly after midnight then updates on webserver for all 8 files. The only obstacle is the processing of the systeminfoTable.txt file before the FTP. Hoping my sequence order allows for processing before FTP. I will know after midnight.

As you can detect, I am hesitate :oops: to implement a Windows scheduler and DOS batch file.

Enjoy,
Paul

Re: External program

Posted: Thu 21 Nov 2019 9:34 pm
by Phil23
PaulMy wrote: Wed 20 Nov 2019 9:52 pm As you can detect, I am hesitate :oops: to implement a Windows scheduler and DOS batch file.
In that case why not experiment a bit with some simple stuff to try.

Stuff that won't impact your data.

Start out with a batch file like this....
(Call it Test.bat)

Code: Select all

pause
Echo Hello
Dir C:\
pause
Then work out how to schedule it & set it to run a minute of two from the time when you are testing.

As you get the hang try adding other things that will not use your data until you get confident.

Phil