Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Jmendes1
2011-08-19T21:55:22Z
Hello,

I noticed that you provide several methods for shutting "off" the server, such as calling server.stop(), or changing the 'On' field to false. This offline mode no longer takes into account the schedule and future jobs until it is turned back on. The problem is that after you turn it back on, jobs that have the "Run missed Jobs once at Start" property checked and were supposed to be executed during that downtime are not executed. When you shut down the "Service" instead (right click on VC on the task manager tray, Server, Service, Off, the entire Server process is killed, and the client can no longer connect to it. Once the server comes back on from this 'Service off' mode, then the jobs with the "Run missed" property get executed at start.

I was wondering how I could programatically call this "Service" off command. When some jobs get stuck, due to performance reasons we tend to temporarily shut down the VC scheduler, but we would like jobs that were scheduled during such downtime to be executed. I'm writing a script that checks the currently running jobs, and if they're a subgroup of our specified list of "jobs that possibly get stuck", then we kill the Server service for the time being, with jobs that were supposed to be executed during downtime still eventually getting executed.

Thanks for the help!
Joao
Sponsor
Forum information
Support
2011-08-20T07:46:23Z
You can call the command "net":

net stop VisualCron
net start VisualCron
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Jmendes1
2011-08-22T12:52:12Z
How do I call this command "net" in a C# script? If I have a Server object 's' that was returned by client.connect(connection, true), how do I go on to call that command through 's'?

Joao
Support
2011-08-22T12:56:59Z
We have added this for next version but it is easy in .NET. Something like:

            Dim sc As New ServiceProcess.ServiceController("VisualCron")
            sc.Stop()

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Jmendes1
2011-08-23T15:04:20Z
Using the windows service controller worked as planned! thanks a lot!

This is the code I used in C# (almost exact to the VB.NET one above).

ServiceController sc = new ServiceController("VisualCron");
sc.Stop();


Make sure you have admin privileges, or it will not work.
Scroll to Top