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


Robert Freeland
2018-09-21T16:07:23Z
Is there a way we can in VisualCron in a scripted fashion "Turn the Server Off", "Wait for any VC running jobs to completed, "Restart the VC host computer", "Turn the Server back on". Any help or advice you can offer on this would be greatly appreciated. We are on version 8.3.3
Sponsor
Forum information
Support
2018-09-25T09:33:40Z
You can do anything that the Client can do if you use the VisualCronAPI. This can be accessed with .NET directly or through PowerShell. There is API/samples folder in the installation.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jrtwynam
2018-10-01T12:25:13Z
I'd be interested to know more about how to do this as well. I recently implemented a job that runs every 1 minute, and ever since then, I've noticed that the VC "service" (not sure if that's the right word) seems to crash. I'm talking about the thing that calculates the next run time of a job each time it finishes. I have a variety of jobs set up, and when this happens, it'll run the jobs at whatever the next run time is, but then it won't calculate the run time after that, so effectively it just won't run the jobs again after that. The only way I've managed to get it working again is to completely reboot the virtual machine that we have VC running on.
Support
2018-10-09T07:35:45Z
Originally Posted by: jrtwynam 

I'd be interested to know more about how to do this as well. I recently implemented a job that runs every 1 minute, and ever since then, I've noticed that the VC "service" (not sure if that's the right word) seems to crash. I'm talking about the thing that calculates the next run time of a job each time it finishes. I have a variety of jobs set up, and when this happens, it'll run the jobs at whatever the next run time is, but then it won't calculate the run time after that, so effectively it just won't run the jobs again after that. The only way I've managed to get it working again is to completely reboot the virtual machine that we have VC running on.



It sounds strange. Maybe you could export the Job to us and tell us how to reproduce this. Please send details to support@visualcron.com
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jrtwynam
2018-10-17T17:34:28Z
Unfortunately, I don't know how to reproduce it, since it doesn't happen all the time. I originally thought it was due to that job that runs every minute, but now I'm not so sure. It might be just due to a whole bunch of different activity within VisualCron, since last time it happened, it was when I was creating another job.

I did manage to reduce the effect though. Instead of having VC create the XML strings, I wrote an MS Access database VBA function that does it. This function loops through the data in the same way VC was, and it creates the XML strings and outputs them to a text file. VC then picks up the text file and processes the XMLs. Doing it this way also sped it up to around 30 XMLs per minute instead of 10 XMLs per minute.
jrtwynam
2018-10-30T12:30:49Z
Hi,

The service stopped again, sometime around 8:33pm last night. When I execute jobs manually, it will run the job, and will calculate the next run time, but when it reaches that run time it doesn't automatically execute the job. I went digging through some log files and found some stuff, but I have no idea if it'll be helpful or not.

This is from the log_server20181029.txt file. For some reason, it looks like the time on the server skipped a second, going from 8:33:11 to 8:33:13. It recalculated all the next run times ok, but it didn't run them at these new times.


10/29/2018 8:33:10 PM	Info	Task completed (Success)->'Set PROC_QTY' (8485755)
10/29/2018 8:33:11 PM	Info	Task started(Set Job Variable): Set CATCH_WT_QTY (8485758)
10/29/2018 8:33:13 PM	Debug	Current time: 10/29/2018 8:33:13 PM
10/29/2018 8:33:13 PM	Debug	Last time: 10/29/2018 8:33:11 PM
10/29/2018 8:33:13 PM	Info	Running missed Jobs between 10/29/2018 8:33:11 PM and 10/29/2018 8:33:12 PM (RunMissedInterval)
10/29/2018 8:33:13 PM	Debug	Triggers will be recalculated due to time change in the system. (10/29/2018 8:33:11 PM - 10/29/2018 8:33:13 PM)
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Backup Settings' is: 10/29/2018 11:00:00 PM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Delete Old Server Log Files' is: 10/29/2018 11:10:00 PM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Tasks in Stat Code 88' is: 10/29/2018 8:35:00 PM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Update Carton Types' is: 10/30/2018 12:55:00 PM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Update Skid Traveller Database' is: 10/30/2018 5:30:00 AM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Users Inactive for Over 90 Days' is: 1/1/2019 9:00:00 AM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Update E-Commerce Ship Days' is: 10/30/2018 6:00:00 AM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Table History Accumulator' is: 10/29/2018 8:35:00 PM
10/29/2018 8:33:13 PM	Debug	Next execution (7) for job 'Run Skid Traveller Reports' is: 11/4/2018 9:00:00 AM


This morning, I manually ran some jobs to get it to calculate the next run time of 8:10am. I then turned on extended debug logging and waited until 8:10. This is a piece of today's log_20181030.txt file:


10/30/2018 8:10:14 AM	Info	JobAPI->Save->Saving Jobs (64) - in shut down: False
10/30/2018 8:10:15 AM	Debug	GetFinishedTriggerResultObjects->Done: 5, not done: 1, time not right: 0, finished: 5, total: 6
10/30/2018 8:10:15 AM	Debug	RemoveTriggerResultObjects->Removed 5, left: 1
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Start
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: If STAT_15 = Yes, continue with update IsNotification: False, minutes: 9612
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: Update Message Stat Code to 95 (error) if XML Status = FAIL IsNotification: False, minutes: 10565
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Montreal PTS Hub - 002 - Write Detail Message, Task: Set XML Detail IsNotification: False, minutes: 9856
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Montreal PTS Hub - 001 - Main, Task: Set LAST_KNOWN_LOCN IsNotification: False, minutes: 4167
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: Log File Not Found if FILE_EXISTS = False (skip to end of job) IsNotification: False, minutes: 11280
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: Update Message Stat Code to 95 (error) if XML Status = FAIL IsNotification: False, minutes: 11048
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Montreal PTS Hub - 001 - Main, Task: Set USER_DEF_VAL_1 IsNotification: False, minutes: 4167
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: If STAT_15 = Yes, continue with update IsNotification: False, minutes: 8229
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: Log File Not Found if FILE_EXISTS = False (skip to end of job) IsNotification: False, minutes: 10698
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: If STAT_15 = Yes, continue with update IsNotification: False, minutes: 7156
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: If STAT_15 = Yes, continue with update IsNotification: False, minutes: 11048
10/30/2018 8:10:15 AM	Debug	RemoveTaskProcesses->Long running Job: Calgary PTS Hub, Task: If STAT_15 = Yes, continue with update IsNotification: False, minutes: 10565


There are many lines that say RemoveTaskProcesses->Long running job. The first one above is on line 3701 of the log file; the last is on line 216828, and every line in between is related to removing a task process. So it looks like it's trying to remove a long running job, but I don't understand that because there actually aren't any jobs running at all, long or otherwise.

I tried turning the server off and back on using the button in the top-left corner of the client. When I turned it back on, it did recalculate all the next run times, but again, it didn't automatically execute the jobs when they reached those times. The only way I've found to completely fix this is to reboot the machine, but that's not a viable solution if I have to do that every couple of weeks.
Support
2018-10-31T13:37:46Z
Do you have any *.dmp files in the log directory of installation?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jrtwynam
2018-10-31T15:48:05Z
I checked the C:\Program Files (x86)\VisualCron\log folder, but I don't see any *.dmp files. I see a variety of files named similar to this:

log_interactivelogonCP20181031.txt
log_server20181031.txt

Those formats have a file for each date back to Oct 1. I also see these files:

mailtest.txt
server_startup.txt
VisualCron4.sdf
Support
2018-11-01T09:23:29Z
Originally Posted by: jrtwynam 

I checked the C:\Program Files (x86)\VisualCron\log folder, but I don't see any *.dmp files. I see a variety of files named similar to this:

log_interactivelogonCP20181031.txt
log_server20181031.txt

Those formats have a file for each date back to Oct 1. I also see these files:

mailtest.txt
server_startup.txt
VisualCron4.sdf



Sorry, I read it wrong. There should not be a dump file as there is no crash. The Restart Task should be fine for this. Maybe it is a limitation in the user you have selected (Credential).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jrtwynam
2018-11-01T14:32:44Z
Are you referring to the Restart Service task? That's an interesting idea... my own account doesn't have access to restart a service, but VC runs under a service account. It certain has access to see all the services (I can see them listed in the Service Name field on the Restart Service task), so maybe it would have access to restart them.

I just tried it, and it was able to stop the VisualCron service. However, with the service now stopped, it has no way to restart it. That is, the VC service was running, and so it was able to stop itself. But now it's not running, so it's not able to start itself. I imagine the Restart Service task would work fine for other services, but not this one.
Support
2018-11-02T15:49:25Z
I am thinking I am getting you now. I think you do not want to restart the VC service because then you lose control.

Theoretically what you can do is to create a script or that uses the API to turn off VC (not the service but VC server). Then no further scheduling will occur unless you check the "Ignore server off" in the Trigger. This way you can start it again from outside. Or run the script from outside.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jrtwynam
2018-11-05T00:21:32Z
I'm not sure I understand. You're saying I could create a script to use the API to turn the server off - that part, I get. Presumably, I'd also need a script to turn the server back on (possibly the same script). So if I checked the "ignore server off" option in the trigger, it would run the job regardless of whether or not the server was on? But isn't it the server itself that runs jobs? If so, how would the job get run if the server was off?
Scroll to Top