AnsweredAssumed Answered

file watcher - if file exists, fail the job

Question asked by nadajetdi on Jul 23, 2016
Latest reply on Oct 6, 2016 by Chandru.Venkataraman



I have an ssis package that will generate a text file (ex, badData.txt) when certain condition is met, and save that file on a folder (ex, ../watch/) .

I would like to create a job that watch for file with extension .txt. If file exists, raise alarm.

The problem i have with file watcher is that if the file exists, it returns success - which is not what i wanted. I thought of using look back but can't figure out how to approach it.


Is it possible to do what i need?


Below is my file watcher job setting. I set alarm_if_fail to 0 because i only need it to alarm if success, and that is where i'm stuck at. Where do i go from here?


/* ---------------------------------- */

insert_job: nightJob   job_type: FW

machine: winAgent

owner: someone@US


date_conditions: 1

days_of_week: mo,tu,we,th,fr

start_times: "5:00"

description: "watch for file with .txt extension"

alarm_if_fail: 0

watch_file: ../watch/*.txt

watch_interval: 60