Page 3 of 4

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Sun 25 May 2014 12:01 am
by captzero
Just an update on my progress...
Eventually, I created two batch files, one to start the program if the sun was up and the other to stop it if the sun had set.
Cumulus processes each xxxxT.bat file and saves as xxxx.bat.
I wasn't happy with the limitations of Windows Task Scheduler so I'm using 'System Scheduler Pro' to run each batch file.
I only run the batch files during the required 'time window' (dawn (on) batch file from 4.20am to 6.15am each day and the dusk (off) batch file from 5.20pm to 6.45pm). This will cover the earliest and latest dawn/dusk times over the year.
I can schedule each file to run during certain hours, run silently in the background with no command window and add automatic key strokes to close windows etc.
Everything seems to be working fine.
Thanks to everyone who assisted.

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Sun 25 May 2014 1:32 am
by ace2
captzero wrote: 'System Scheduler Pro' ..
Is that the one made by splinterware???

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Sun 25 May 2014 3:25 am
by captzero
ace2 wrote:Is that the one made by splinterware???
Yes.

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Sun 25 May 2014 10:12 am
by ace2
Mm, might look into that program, my current scheduler doesn't have between hours of.

I normally use a script which uses the hours from current time.

Code: Select all

if %time:~0,2% EQU (hour)goto start
Exit
And run every hour.
Easier using the scheduler!!
Tx

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 7:29 am
by ace2
Why would task manager show multible cmd, ffmeg and my other scripts???
I have a exit on every completion and end of every script, scripts run and complete fine.....

Do I need to run a taskkill at the end or something???

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 7:47 am
by mcrossley
ace2 wrote: Do I need to run a taskkill at the end or something???
You shouldn't have too, what parameters are you using to start the script?

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 8:10 am
by ace2
mcrossley wrote:You shouldn't have too, what parameters are you using to start the script?
Excuse my basic script.....

cumulus processes the timeT.txt for all my variables.
I then use the timeswT that BCJKiwi posted on this thread in my script. I changed it to use the output %RFLAG% as a switch 1=on & 0=off.

I then set my mini lapse script to run on certain times, i then run this script hourly. If cumulus time = X goto X

**all user names and passwords have been removed**

I wonder if it's my version of ffmpeg causing it???

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 8:36 am
by mcrossley
It was more how you invoked the script rather than the script itself.

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 8:38 am
by ace2
mcrossley wrote:It was more how you invoked the script rather than the script itself.
oops.............but the script decide if it runs or not depending on variable

set to run via a task scheduler(not windows one) every hour...

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 11:21 am
by ace2
It seems any script that invokes ffmpeg cause this. I had 10 processes of my mini lapse script showing, task killed the cmd.exe(about 10 of them as well) closed all my mini lapse scripts, then task killed ffmpeg.exe also 10 odd.
So why would this be happening???
Ffmpeg section completes the process and I have a CLS & exit command after ffmpeg/script.
Sound like my final step at night is to task kill all those processes.....

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 11:51 am
by mcrossley
Same question again really, how are you invoking the script from the scheduler?

Also you are using GOTO EOF, and have defined an :EOF label. EOF is a built-in label which means jump to the end-of-file and return to the calling script. How it behaves with a defined label I'm not sure. GOTO EOF is usually used when you use sub-routines (or at the end of external scripts) to jump back to the main code where you made the call to the sub-routine.

I would replace your :EOF label with :END and replace all your GOTO EOF with GOTO END
You could also replace all your exit points...
CLS
exit

with GOTO END as well.


Picky, but you have quite a few SET /A commands where you are not doing any arithmetic (such as "set /a SFLAG = 0"), you do not need the /a flag in these cases.

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Mon 02 Jun 2014 12:07 pm
by ace2
mcrossley wrote:Same question again really, how are you invoking the script from the scheduler?

Also you are using GOTO EOF, and have defined an :EOF label. EOF is a built-in label which means jump to the end-of-file and return to the calling script. How it behaves with a defined label I'm not sure. GOTO EOF is usually used when you use sub-routines (or at the end of external scripts) to jump back to the main code where you made the call to the sub-routine.

I would replace your :EOF label with :END and replace all your GOTO EOF with GOTO END
You could also replace all your exit points...
CLS
exit

with GOTO END as well.


Picky, but you have quite a few SET /A commands where you are not doing any arithmetic (such as "set /a SFLAG = 0"), you do not need the /a flag in these cases.

Sorry, the .bat is converted to a silent exe with bat to exe convertor. So it's called as an exe.

Mm, will replace all my exit ones. strange enough, I used END on all my others.

The script has all the left over stuff cause its used in more than 1 script that utilizes the RFLAG, hence why some useless code exists. Easy to use one universal working script for all and change 1 line to suit the needs.

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Tue 03 Jun 2014 9:31 am
by ace2
I'm still getting multiple CMD, NTCFTP, Mini lapse hourly and FFmpeg showing in task manager.(about 12 of each)

I've added the GOTO END on all exits and the :END at the end of script
(once again this script is converted to a silent exe, not run as a .bat)

closing FFmpeg kills all mini lapse hourly listed, i close all cmd amd ntcftp(my ftp command line program)

The mini lapse hourly runs every hour by a standalone task scheduler program and completes fine.
I just don't understand why these tasks are not closing........

I have included my script in case anyone can see my error.....

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Thu 23 Oct 2014 10:59 pm
by ianboag
Just to pick this one up again ...

I am doing an airfield station with pix. The pix are snapped and uploaded by a batch file that runs as the "external program". All works fine. I can see how to use <#isdaylight> etc to stop it taking pics and uploading them at night. I would actually like it to stop uploading altogether at night? Is there any way to do this in cumulus without going to external schedulers and stuff?

Ian B

Re: Run External Programs based on Sunrise/Sunset webtags

Posted: Thu 23 Oct 2014 11:55 pm
by steve
ianboag wrote:I would actually like it to stop uploading altogether at night? Is there any way to do this in cumulus without going to external schedulers and stuff?
No, sorry. Improving the scheduling is one of the things on the to-do list.