Tutorial 05: Chaining jobs for smart e-mail log notification

February 11th, 2008

In this fifth tutorial we’ll leverage some neat features available in Fileaze starting from version 1.0.4 to get a job’s log via e-mail by automatically chaining two job executions.

Note: this tutorial presumes that you followed the previous ones and are able to perform the operations explained there.

Fileaze (starting from version 1.0.4) allows you to chain job execution by specifying what job to run after the completion of a given job. This feature opens a huge range of possibilities but it’s important to understand that the jobs are kept totally independent of each other and the chained execution is an automated way to achieve what previously you could only do manually. A typical usage of this feature is to have a secondary job e-mail you the log file of a primary job automatically. In this tutorial we explain how to create this workflow.

Let’s start by creating a simple job that makes a copy of a file:

(We won’t dive into details here, this step is trivial if you followed the previous tutorials)

1.jpg

Now run the job and open the log window. The title bar shows the full path of the log file (highlighted with a red rectangle here). This is the file we’ll attach to the e-mail when creating the secondary job. Note that the file is named after the internal job ID and will be different when you replicate this tutorial. Take a note of the name for reference in a later step.

2.jpg

Close the log window and create a new job. This will be the secondary job that e-mails out the log file so let’s name it “E-mail log file”:

3.jpg

Add a File source that points to the log file previously identified:

4.jpg

Then add an E-mail action filling in the parameters as needed (remember to add an e-mail account inside the E-mail Accounts window if you didn’t already do it) and save the job:

5.jpg

Now let’s get back to the main job. Edit the job and go to the Advanced tab.

It’s usually a good idea to enable the option to automatically clear the log before every job execution to avoid e-mailing log files that get longer and longer. Also, starting from 1.0.4, you can decide here what to log (every event, errors only or nothing at all - which wouldn’t fit this tutorial use case, of course).

Inside the “Secondary job execution” we need to indicate what job to run after the main job’s execution. Here we have several non-exclusive options to choose from, depending in what cases we want the secondary job to run (successful execution with or without actual sources or with minor errors or failed execution due to major errors - refer to The Advanced tab inside the application help files for more details). Let’s choose the first option: enable the first checkbox and choose the E-mail job you just created from the menu:

6.jpg

We’re done. Save the job and run it. If everything was setup correctly, you will get the usual Running job window

7.jpg

but this time, when you click “OK”, the secondary job will run

8.jpg

Note: In case of a scheduled job, no manual operation will be needed. The secondary job will run automatically after the first job finishes.

After a while, check your inbox. You’ll find the e-mail message sent by Fileaze

9.jpg

with the expected log file attached!

10.jpg