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


jamesTrix
2009-12-15T04:15:15Z
Ok bit of a interesting task.


I am trying to setup a trigger/Task that will poll a folder for new XML files, if it finds new XML files it will create a NewZIP file. It will then copy the Zip File to one folder eg clientData and then move another copy to an Archive folder once this is completed it can remove the Zip file from the original directory.


IF XML File Created in C:\FTP\
1 Compress and Remove XML files Place in RANDOMGUID.ZIP
2 COPY RANDOMGUID.ZIP TO c:\Client1\
3 COPY RANDOMGUID.ZIP TO c:\Archive and Remove C:\FTP\RANDOMGUID.ZIP


This was how I was trying to do it with 3 Tasks but I was trying to work out how to put

"C:\FTP\{USERVAR(Create Random GUID)}.zip" in to a user varable so that I could use it in tasks 2 and 3.

Or is there a better way to do it ?

On a side Note When we have been using time based triggers we have seen the Server be come slow and sluggish. Should we speak to file based Triggers ?
Sponsor
Forum information
Support
2009-12-15T09:09:06Z
File Triggers are much more effective than polling a folder.

They way you do it is probably the most effective, you can reuse the same user Variable.

Another method is dividing it into 2 Jobs with two File Triggers. So, you use the random function and create a new file in a new folder. Then you can reuse the full path (random file) from the second File Trigger. But I would probably go for your alternative first.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jamesTrix
2009-12-15T20:41:35Z
Thanks support once again for your hints, I have been trying to get the archive path in to a variable but have run in to a problem.

When I setup the Archive path for the creation of the zip file, I first used a variable that also had the local path statement in it eg

eg c:\FTP\{USERVAR(Create Random GUID)}.zip

The in my Copy Task I used

{TASK(8cd3f634-fb6e-4e01-bb21-fee11f2b501d,ArchivePath)}

When I used that variable for the copy statement it failed second path fragment error must not be a drive or UNC name path 2

As it did not like having the file path

c:\FTP\4759e416-4457-4f81-a752-1d6fb58c169c.zip

I removed the local path statement from the ZIP task but now I have no idea where the zip file is being created the log file does not give any hints

16/12/2009 6:37:46 AM Info Task started: Compress New XML files (27)
16/12/2009 6:37:47 AM Info Task completed: Compress New XML files (27)
16/12/2009 6:37:47 AM Info Task started: Move File (28)
16/12/2009 6:37:47 AM Info Task completed: Move File (28)
16/12/2009 6:37:47 AM Info Job process was aborted by user.
16/12/2009 6:37:47 AM Info Job completed: Trigger and Compress new XML Notifications
16/12/2009 6:38:42 AM Debug Saving Jobs


jamesTrix attached the following image(s):
Support
2009-12-16T11:15:36Z
Not sure I follow you. Why did you not create a path before the random guid variable in Archive path?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jamesTrix
2009-12-17T19:28:01Z
As it gives this error

"second path fragment error must not be a drive or UNC name path 2"
Support
2009-12-17T19:31:30Z
Sorry, missed the flow.

Probably, as I suspect you are using the File filter for the Copy files Task, it expects two values to find the file. Directory and filter (name). Where and how do you use the path? Remember that it is a full path so you need functions to get directory and file name of that Variable.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top