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


agilence
2018-09-06T16:10:55Z
Can a trigger be set to monitor a top folder and any file delivered to a sub folder triggers a copy job to copy all sub folders to 2 locations
i.e.
top foler
sub folder 1
sub folder 2
sub folder 3

A file is delivered to any sub folder and all the folders and its contents delivered to second and third server with the same folder structure
Sponsor
Forum information
thomas
2018-09-07T08:36:32Z
Sure, just check the 'include subfolders' box in the filetrigger event. Under variables, go to your job, triggers, and you will get the name of the file that was added. From there you can copy it anywhere you like

Capture.PNG
agilence
2018-09-13T16:44:11Z
Thank you for the reply I need to know is it possible to have 2 jobs

job 1 is looking at the top level folder and coping a file delivered to server A

job 2 is looking at a sub folder of the dame top level folder and need to copy the same file to server B

Is there a way best create the job? I have tired this with a delivery of a 300 files to sub folder and the job triggering on the top level folder copies all 300 files but the job triggering on the sub folder eventual will report failure " Exception in Task: No file(s) copied"
on first run it was after 184 files on second run it was on 253 files before failures
thomas
2018-09-13T19:52:27Z
I may have misunderstood what you are trying to accomplish, but I would make 1 job only:

1) Make a job that monitors a folder AND all its subfolders
2) When it triggers, get the full path of the file in question (it will fire once for each file)
3)Analyze the path of the file. If it is eg c:\topfolder\file.txt copy to server A. If it is c:\topfolder\subfolder\file.txt copy to server B
Support
2018-09-14T14:38:36Z
Thanks Thomas. Additionally you might want a Task creating any folder (if it does not exist).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
agilence
2018-09-14T16:26:12Z
Thank you for your suggestion but I'm not sure that will accomplish my goal of the file being delivered be copied to 2 servers. All files will be delivered to c:\topfolder\subfolder(x)\file.txt copy
Server A files deliver to
top folder
sub folder 1
sub folder 2
sub folder 3

Server B
top folder
sub folder 1
sub folder 2
sub folder 3

Server C
Top Folder
sub folder 1
sub folder 2

file delivered Server A sub folder 1 , copy of file needs to be sent to Server B sub folder 1 AND Server C sub folder 1
file delivered Server A sub folder 2 , copy of file needs to be sent to only Server C

I set job 1 to trigger on top folder of server A and send all files to Server B coping file structure
I set job 2 to trigger on Sub folder 3 of server A and send file to Server B sub folder 3 only

Not sure if this explains better
Henrik - can we arrange a quick call to discuss?

Thank you
Scott


thomas
2018-09-14T18:56:05Z
Hi Scott

I'll make an another attempt :)

So only files on server A needs to be monitored. If the file is delivered to subfolder 1, copy to subfolder 1 in in both B and C. If file is delivered to subfolder 2, copy only to subfolder 2 in server C. Is that correct?

If so, there are a few ways to solve it. I will list 3 possibilities here, the last one is potentially the simplest one

1) You can use 2 triggers the way you suggested. The problem is that it's not really a scalable solution. If you want to add another subfolder one day, you will need to add another trigger, and so on.

2) You can have one trigger monitor topfolder and all subfolders. Then you get the folder name of the triggered file. Let's say it is subfolder 1. You then need to look up somewhere ( a table or a file for example) what this folder is mapped to. So subfolder 1 will be mapped to server B and C. subfolder 2 will be mapped to C only. So looking up subfolder 1 would return B and C. You would then loop over this and copy to both servers. You will end up with a bit of looping here, and copying one file at the time, so if we are talking about hundreds of files, it isn't terribly efficient.

3) Ok, this is by far the easiest, IF the following assumption is correct: It seems to me that you want subfolder 1 on Server A to be in sync with subfolder 1 on Server B and C, and subfolder 2 on Server A should be in sync with subfolder 2 on server C.

If this is correct then you can just create a job that has a sync file task between Server A subfolder 1 and Server B subfolder 1, and so on. You can have it run every minute or so, if you can live with that lag. You don't even need a trigger for this solution. If not, you can have it be triggered by files arriving on Server A. I can expand on that part if you want

thomas
agilence
2018-09-18T18:06:11Z
Thank you Thomas I do believe option 3 is the best and if you can expand on the triggers I would greatly appreciate it.

Again thank you for your help!
thomas
2018-09-19T14:51:26Z
Nope, sorry. The trigger thing in 3 didn't work as I expected. If 100 files are dumped to server A, I wanted to do an OnComplete in the flows tab, and then call the job that syncs the servers. In that way, it would sync between the servers once, regardless of the number of files. The trouble is that the onComplete fires for each file, not after the triggering has completed. So the syncfile job will be fired 100 times, which makes it pointless (in that case a regular copy is better)

One option is to go with 3, without triggers and sync often. Alternatively you have to go with what you attempted. I don't know why it fails after x number of files. Support would have to answer that. Did you click 'yes' when the popup box appeared and asked to put the job in queue when adding the trigger?

Scroll to Top