Community forum

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


BrianC
2008-12-09T15:32:53Z

We are moving off of our old scheduling software and are converting all of our jobs over to Visual Cron. One item that has created a slight problem for us is that we are used to having an option in the conditions for a "File Exists and Is Not Locked" status. We have files that are sent via FTP. The files take up to a minute to create, but the job sees that the file exists and starts the job. The job fails because the file is still in use by another program (the FTP software). This has created an issue for us. It didn't corrupt the file but we are worried that may happen sometime down the line.
If the "File Exists and Is Not Locked" could be an additional option in the conditions that would be a great addtions. or possibly enhancing the Triggers for multiple triggers. If there was option for an "and" in addtion to the default "or" when defining the multiple triggers.
Any input would be appreciated. Thanks!
Sponsor
Forum information
PeterW
2008-12-09T21:01:12Z
There is already an option in the file trigger that allows the job to execute when the file lock is released. If you open your file trigger and go to the "File" tab you should see a checkbox that says "Trigger when file has been released".
BrianC
2008-12-10T15:42:03Z
I have tried that option, but we have multiple criteria that need to be met. That's why we want it to be a condition. If the Triggers had an "action" tab like the conditions do that would be great. Then multiple triggers could be utilized with the "Trigger when file has been released" option. Or the "Trigger when file has been released" could be added to the conditions. It just seems like if a condition is met when the file exists, there should be an option to make sure the file is Not Locked.
PeterW
2008-12-10T16:24:32Z
Can you provide all the steps your job does in order as well as the conditions attached to each task? Also, what triggers are attached to this job? Is it just the file trigger or is there a timed execution as well? From reading your posts so far this is what I understand:

Step 1: A program outside of VisualCron downloads the files from an FTP site.
Step 2: Once the files have been downloaded, VisualCron is supposed to start a job (or is it multiple jobs?) that process them.

Is this correct? If so, have you considered having VisualCron perform the FTP actions to download the files? That way once it completes the very next step in the job will be the task that processes them. I have setup multiple jobs on our system where the first step is to download the file then perform a PGP decrypt, or run a program, or archive the file, etc. I haven't experienced any file locking issues when doing it this way.

Regards,

Peter
BrianC
2008-12-12T19:08:01Z
The files are being sent via FTP to us from an external source. It is 2 files that are being created. The problem is that both files take up to a couple minutes to fully complete. The files do not arrive at a particular time. The files also come in random order. File "X" may be pushed to us before file "Y" or vice versa and the first to be pushed to us does not mean that file will be completed first.
This is our reason for wanting to use multiple triggers. If that existed, we could just create triggers that would "trigger when the file has been released" for each file. When both files were released the job would start. If we set these as conditions the jobs start when the files are first created (and are not complete).
PeterW
2008-12-12T23:16:08Z
So you only want the job to execute when both files have been fully received? Hmm. Yeah it would be nice to have a condition that could check for a file lock in this situation. I have a solution that might work however it is not very elegant.

Job 1: When file "X" is received and the lock is released it fires and creates a simple text file (for example "fileX.txt") that signals the receipt is complete.
Job 2: When file "Y" is received and the lock is released it fires and creates a simple text file ("fileY.txt") that signals the receipt is complete.
Job 3: This runs on a timed trigger (Every 5 minutes for example). Attach a condition set that looks for "fileX.txt" and "fileY.txt". If they don't exist, exit the job. Otherwise do your processing and delete the two files once complete.

You will run into issues if Job 1 or Job 2 attempts to write the flag file while Job 3 is running however if you know you will not receive files "X" and "Y" more than once a day this should work.
Scroll to Top