Email notification if no file is copied (copy task)

Discuss email problems

Email notification if no file is copied (copy task)

Postby melvin » Sat Jan 03, 2015 12:44 pm

user support request:
How can I capture and email a notification when a job has an exit code = 0, even though the copy didn’t happened sometimes. Whether the copy is successful or not, the exit code remains 0 (please see task log for entries on Dec 31, 2014 and Jan 1, 2015 to see more details) In this directory (E:\benefits), there are many files, but only one meets the criteria below ( contact*.txt)… it copied on Dec 31, but not on Jan 1.. yet both have the Exit Code = 0..
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california

Re: Email notification if no file is copied (copy task)

Postby melvin » Sat Jan 03, 2015 12:45 pm

Your task never failed. That is why exit code = 0. The file did not copy because it did not pass the criteria set, and this does not imply failure or error. Unlike the Ftp/SFtp tasks, the copy task does not set an exit code = –100 if files are copied.

You should run the copy task in a task sequence. After the copy task, run a variable monitor task to monitor the variable “Copy_contact_files::FilesCopied” . For the variable monitor task,:
Variable name: Copy_contact_files::FilesCopied
Variable value: 0
comparison criteria: >
Task to run: None

The variable monitor will set an exit code = –100 if monitoring condition is met. If monitoring condition is not met, it will set exit code = 0. Base your email notification on variable monitor exit code.
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california


Return to Email

Who is online

Users browsing this forum: No registered users and 1 guest

cron