SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
How to create a template to check dynamic file name

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
How to create a template to check dynamic file name
Author Message
arnaud_dupuis



Joined: 09 Oct 2007
Posts: 2

Post How to create a template to check dynamic file name Reply with quote
Hello,

I want to create a template to create jobs which test if a file exists, the filename change each day (file_ddmmyyyy.log).

Most likely I use in the job script :

Dim fex, boolean
FileExists("file@T"ddmmyyyy".log", fex)

But when I try to create a template with the following script :

Dim fex, boolean
FileExists(%FILE%, fex)

and use a EDIT field in the wizzard (and the the problem is the same with a (REMOTE) FILE BROWSE), I got the following generated script :

Dim fex, boolean
FileExists("file@T\"ddmmyyyy\".log", fex)

If I enter "file@T"ddmmyyyy".log" in the wizzard field.
Obviously it's not the behaviour I expected.

Could you please give me some hints ?

Thanks,

Arnaud Dupuis
Tue Oct 09, 2007 4:06 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
%FILE% placeholder means that you want the template wizard to display a prompt for the file name in this place when you are creating a new job. In your case, you don't need a prompt because the file name is calculated, so in this place you simply need to enter the actual value, which is "file@T"ddmmyyyy".log" In job run-time 24x7 will replace this value with the calculated date.
Tue Oct 09, 2007 9:01 am View user's profile Send private message
arnaud_dupuis



Joined: 09 Oct 2007
Posts: 2

Post Reply with quote
Hmm no,

I want to make a wizzard wich allow people (who knows about the macro-parameters) to create,very quickly, new jobs with different macro-parameters.

for example, I want to be able to create (with my wizzard) the jobs to watch for a file "c:\nt_backup_@T"mmddyy".log" and "d:\sales_@T"mmddyyyy".log".

The problem is that I want mty users to enter themselves (via the wizzard of the template) the file pattern.

And for the moment I got only a stringify path like : "c:\nt_backup_@T\"mmddyy\".log" or "d:\sales_@T\"mmddyyyy\".log"
Tue Oct 09, 2007 9:47 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
The file browse dialog doesn't prevent people from entering any file name directly into the template field including names having macro-values. The issue here is that if they enter anything that contains special symbols, for example, double quotes, the wizard automatically inserts escape characters into the value to avoid job script syntax errors. To "undo" that you need un-escape them in the job script

Create a custom user-defined statement like ReplaceAll (a complete example is provided in the sample job database file) then in the job script add
ReplaceAll FILE, "\\\"", "\"", FILE
Tue Oct 09, 2007 2:30 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.