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


keithdavis
2014-02-14T12:40:49Z
I have multiple file based triggers for a job, but I only want it run once, not if multiple files were modified.

How do I accomplish this?

If I disable the Put Job in queue, will that work? If I disable that, I get the "Event based triggers should be in the queue" warning.
Sponsor
Forum information
Support
2014-02-14T13:29:43Z
Not sure what you mean but it will run once unless you are monitoring the same folders (so the same file triggers twice).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-14T17:01:18Z
We monitor several files in multiple folders, so that if any one of these critical files changes, the process runs.

However, it's possible for more than one of these files to be altered at once, and so then we only want it to run once, but I've witnessed it run twice.
keithdavis attached the following image(s):
Support
2014-02-17T07:25:32Z
I think the best way to troubleshoot this is to write the triggered file to file (along with the time) with a File write Task. Also, not sure about the Time trigger that you use, how that works, but that can confuse things.

Also, make sure that you only use "Created" and not "Changed".
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-17T12:14:19Z
Originally Posted by: Support 

Also, make sure that you only use "Created" and not "Changed".



But we need this to be triggered if the file last write has been changed.

Originally Posted by: Support 

I think the best way to troubleshoot this is to write the triggered file to file (along with the time) with a File write Task.



Before we do that, I still am curious. Wouldn't checking Do not run job if it's running but unchecking Put Job in queue solve this problem? I've tried that, but VisualCron prompts me to check the box back and so I don't understand how it works (maybe.)

Originally Posted by: Support 


Also, not sure about the Time trigger that you use, how that works, but that can confuse things.



What Time trigger?
Support
2014-02-17T12:52:27Z
Quote:

What Time trigger?



In the screenshot there is a Time trigger listed among triggers.

Quote:


But we need this to be triggered if the file last write has been changed.



This might result in multiple time triggers. It depends on your problem. If the problem is immediately duplicate trigger or with some delay. You can increase this "delay tolerance" on the Trigger. But we do recommend using "Created" only and move files when you are "done" with them.


Quote:

Before we do that, I still am curious. Wouldn't checking Do not run job if it's running but unchecking Put Job in queue solve this problem? I've tried that, but VisualCron prompts me to check the box back and so I don't understand how it works (maybe.)



You need to check this if you work with VisualCron Variables. Otherwise it will not be possible to keep track of which file belongs to which Variable.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-17T12:58:45Z
Ok, forgot about the Time Trigger, but that is not when this issue occurs.

Just to be clear, if any of these critical files changes, we need this process to run, however, it's fairly intensive on a production server, so we need it not run excessively. What's happening right now, is, for example, 2 files are changed and so the job runs twice, back to back.

Now, these 2 jobs are not changed at exactly the same time (I think that would be impossible), but the second file is changed, before the job completes, and so as soon as the job completes, it runs again.

And I don't understand how using only the "Created" would serve our purposes - these are config files that are being updated.
Support
2014-02-17T13:01:24Z
It sounds like "Put Job in queue" is the solution for you.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-17T13:03:53Z
Originally Posted by: Support 

It sounds like "Put Job in queue" is the solution for you.



But that is checked (and has always been checked, because VisualCron recommends it.) Does that not "queue" the job to run every occurrence of every trigger. That's what it says, so that jobs are not "skipped."
Support
2014-02-17T13:08:20Z
Originally Posted by: keithdavis 

Originally Posted by: Support 

It sounds like "Put Job in queue" is the solution for you.



But that is checked (and has always been checked, because VisualCron recommends it.) Does that not "queue" the job to run every occurrence of every trigger. That's what it says, so that jobs are not "skipped."



It does, an also prevent multiple instances.

I think you need to, as I wrote in first post, to verify which files are run exactly and when. Create a File write Task and use Variable to write time and name of file. This would confirm the problem in more detail.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-17T13:17:59Z
Originally Posted by: Support 


I think you need to, as I wrote in first post, to verify which files are run exactly and when. Create a File write Task and use Variable to write time and name of file. This would confirm the problem in more detail.



Can you be more specific on how to do that?

Support
2014-02-17T13:30:09Z
Add a Task, at start of Job. That writes the full path and date to a text file. Something like this:

{DATEFORMAT(yyyy-MM-dd HH:mm:ss)} - {TRIGGER(Active|LastTrigger|File.Result.FullPath)}


Then look at the file after it has triggered twice.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-18T23:48:22Z
From the log of what files were triggered:

2014-02-18 17:46:23 - C:\inetpub\wwwroot_noncvs\control_panel.xml
2014-02-18 17:46:47 - C:\PHP\php.ini

Attached is the log file of the job running. I can see what the problem is, our deployment (which is what changes the files) takes longer than the replication (less than 5 seconds.)

keithdavis attached the following image(s):
Support
2014-02-19T07:16:25Z
Originally Posted by: keithdavis 

From the log of what files were triggered:

2014-02-18 17:46:23 - C:\inetpub\wwwroot_noncvs\control_panel.xml
2014-02-18 17:46:47 - C:\PHP\php.ini

Attached is the log file of the job running. I can see what the problem is, our deployment (which is what changes the files) takes longer than the replication (less than 5 seconds.)



Ok, great, so this has been resolved now?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-19T12:32:14Z
No, but I doubt there is a solution. I still need this to only run once for each time we deploy.
keithdavis
2014-02-19T12:42:25Z
What about some of these other settings? What does Trigger dependency do? Or would it be possible to somehow deactivate the job for a period of time after it runs (like 30 minutes.)
Support
2014-02-19T12:46:54Z
Perhaps I am not understanding your original request.

1. you wrote that you need to run the Job if any of the files changes - this works already
2. you have confirmed that file change works and that it handles one file at a time
3. you have the option to put job in queue so it processes one file at a time

Dependencies are used for waiting for multiple triggers to fire (before starting the Job). I do not think that is what you need.

What is the problem exactly? That you do not want it to run the the second time (when the another file fires) during this time period?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-19T12:51:25Z
Correct. Our deployment takes about 30 seconds. We only want this job to run once. However, we need to monitor more than one file, because a single file is not modified every time, so that no matter which of these files is changed during deployment, the job only runs once. I've seen instances where it ran 3 times.
Support
2014-02-19T13:10:31Z
So, then I would use:

1. uncheck put job in queue
2. add a Wait Task in the end of job to block x number of seconds
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2014-02-19T13:11:50Z
Ok, thanks, I'll try that.
Scroll to Top