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.


ahashley
2020-02-06T03:29:18Z
Hi ya’ll, we are currently on the trial and loving VisualCron. I’m trying to migrate something we had WatchFTP doing previously, which is moving new files that show up to our FTP site when they come in, which was extremely easy because even though we have many clients, we were able to add a mask to the effect of */In/* for finding any files in the “In” folders throughout the tree. Is there any way to do this with VisualCron? The folder field in the file filter seems to be literal only, and the file mask field is only for file names as far as I can tell. Thank a bunch!
Sponsor
Forum information
Support
2020-02-06T16:26:04Z
Originally Posted by: ahashley 

Hi ya’ll, we are currently on the trial and loving VisualCron. I’m trying to migrate something we had WatchFTP doing previously, which is moving new files that show up to our FTP site when they come in, which was extremely easy because even though we have many clients, we were able to add a mask to the effect of */In/* for finding any files in the “In” folders throughout the tree. Is there any way to do this with VisualCron? The folder field in the file filter seems to be literal only, and the file mask field is only for file names as far as I can tell. Thank a bunch!



Hi Ahashley,

If I understand you correct, you want to watch a folder (local or remote/network?) and then whenever files come there, they get moved/copied somewhere else.

What you can do is create a job, then you add a File Trigger (we have a good tutorial on File trigger you can watch here: https://www.visualcron.com/tutorials.aspx )
In the file trigger, you set the location of the folder to watch (if it's a network path, use credential and a UNC path, i.e \\pathname\ and not a logical path which would be W:\pathname\) and what files to watch (could be *.* if any files) for.

Then, add a Copy files task in that job, and in folder path, use variable: {TRIGGER(Active|LastTrigger|File.Folder)} (means it'll use the folder that was triggered last time, which would be the file trigger)

Then as file name, you use variable: {TRIGGER(Active|LastTrigger|File.Result.Name)}

Then in Copy settings, you set the destination folder where the file should be copied to, then you can set it to delete the source file, so it basically works as a "Move" command, but just copies it there first, then deletes the original.

You can mail us at support@visualcron.com if you get stuck somewhere and I can show you a little bit more in detail with screenshots or similar. Don't hesitate to contact us, good luck!


Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
ahashley
2020-02-07T02:03:18Z
Thanks Michael, that is useful info and probably the trigger I'll opt for now, though my main sticking point is the mask itself. The reason it was so was so easy previously was because I could simply enter a mask like */In/* to limit the search to only "In" folders, which covered all without having to make anything on a folder by folder basis. I notice there is a mask for excluding folders, but is there any way I can use that to exclude all folders except for the "In" folders?
Support
2020-02-07T10:08:51Z
Originally Posted by: ahashley 

Thanks Michael, that is useful info and probably the trigger I'll opt for now, though my main sticking point is the mask itself. The reason it was so was so easy previously was because I could simply enter a mask like */In/* to limit the search to only "In" folders, which covered all without having to make anything on a folder by folder basis. I notice there is a mask for excluding folders, but is there any way I can use that to exclude all folders except for the "In" folders?



I'm not sure I understand exactly, you can simply just include the "In" folder as the source folder, and it will not search any other subfolders. If you still want to exclude folders, you can exclude multiple folders by separating them with a semicolon ;

Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
bweston
2020-02-07T13:51:00Z
Originally Posted by: Support 

Originally Posted by: ahashley 

Thanks Michael, that is useful info and probably the trigger I'll opt for now, though my main sticking point is the mask itself. The reason it was so was so easy previously was because I could simply enter a mask like */In/* to limit the search to only "In" folders, which covered all without having to make anything on a folder by folder basis. I notice there is a mask for excluding folders, but is there any way I can use that to exclude all folders except for the "In" folders?



I'm not sure I understand exactly, you can simply just include the "In" folder as the source folder, and it will not search any other subfolders. If you still want to exclude folders, you can exclude multiple folders by separating them with a semicolon ;



I think the issue is that the WatchFTP mask is
*/in/*
, meaning the contents of any "in" subfolder anywhere inside the starting location. (Well, depending on how WatchFTP handles paths, actually that might only be if it's the second folder down.) Your replies thus far suggest that you're thinking of a single "in" folder, or at least specifying each "in" folder separately, which - with an "in" folder under each of a large and occasionally changing number of clients - is more of a burden to maintain.

In order for the trigger-and-variable approach you described to handle that, I think it needs either a capability in the trigger itself that I'm not sure exists (I haven't got time to run tests at the moment), or either a condition or a flow control to check whether {TRIGGER(Active|LastTrigger|File.Folder)} is "in" before copying the file. Then it could trigger for any file under any client, but only act it if it's in an "in" folder.

The only other approach I'm sure Visualcron could support in its current incarnation would be to have a control job that checks for added or removed "in" subfolders and adds or removes triggers of the actual watching job via the API...

It certainly seems possible, but yes, "*/in/*" is perhaps a little more intuitive.
ahashley
2020-02-11T14:22:40Z
Thank guys, I wasn't able to find any conditions under the copy file function to help, but I was able to make it work by excluding watched folders matching *\Out*
It's not perfect but it covers the bases well enough 🙂
Scroll to Top