Shakti Prakash Singh
Shakti Prakash Singh

Reputation: 2533

Autosys file watcher for a particular filename on Windows

I am trying to write a file watcher job in autosys that would watch out for a particular file. The file name format would be filename_ddmmyyyy.

The requirement is that the file comes at 7.15am everyday and the file watcher job starts running at 6.50am and the runs till 8am. If the file is received by then, job is successful else an alert is raised.

Now what I am trying to do is to watch out the file filename_ddmmyyyy for a particular day. e.g. if today is 22nd Feb 2013, the file name will be filename_22022013 and this is the file that I am looking for. If I use wildcards like filename_*, it would look for all possible files which I don't want.

I am not sure how to do this in Windows.

Any help would be much appreciated.

Let me know in case of questions.

Upvotes: 0

Views: 5706

Answers (3)

Mrinal
Mrinal

Reputation: 1906

Pretty late to answer, but here is an answer without using global variable. You can use formatted system date variable in the file name.

File_to_watch: filename_%date:~10,4%%date:~4,2%%date:~7,2%

Upvotes: 0

user2750005
user2750005

Reputation: 26

Create global variable as variable with date and us that variable :

example:filename_$${GV_DATE}
GV_DATE: ddmmyyyy

Upvotes: 1

Jeff Evans
Jeff Evans

Reputation: 1307

You will need to use the profile job attribute to initalize variables when the job starts. One of these variables will need to be the date pattern you are looking for (you'll need another process that outputs that dynamically). Then once you set it to a variable in your profile script, you can refer to that variable name from within the watch_file attribute.

Upvotes: 2

Related Questions