Task Sequence based on Variable Value

Discuss Task Sequences and Scripting related issues.

Task Sequence based on Variable Value

Postby melvin » Tue Oct 01, 2013 7:44 pm

User Support Request:

I am trying to create a file move file task and if the task completes with error code = 0 then send a success email but if the job fails to I need it to send a failure email.

I created all the steps and run the task and it will move the file and email the success email no problem.

I remove the file from the source directory and the task still completes with error code = 0 when there is no file in the source directory to move.

Why does this not error when there is no file to move?
I need to know that the file exist and that It move the new copy everyday.
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california

Postby melvin » Tue Oct 01, 2013 7:46 pm

Having 0 files is not an error condition.
You could check the variable value and send the emails based on the variable value.

Create 2 variable monitor tasks:

monitorCopied:
variable name = MoveToDrive::FilesCopied
variable value > 0
Task to run = MoveSuccessEmail

monitorNoFileExists:
variable name = MoveToGDrive::FilesCopied
variable value = 0
Task to run = MoveFailedEmail


Then in your task sequence:
step 1 = MoveToDrive
step 2 = monitorCopied
step 3 = monitorNoFileExists
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california


Return to Task Sequences, Chains and Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron