Southsoftware.com
.:Pricing
Home
Products
Downloads
Support
Contacts
Site Map
.:Advanced Task Scheduler
About product
Download trial
Purchase license
Compare editions
View screenshot
FAQ & Support
Press Kit
.:Articles
Online manual
Blog posts
Videos
More articles...
.:Follow us
Follow us on Facebook Follow us on Twitter Follow us on YouTube
   

Error handling in scheduled tasks

A scheduled task can be run automatically many times after it has been created, configured and tested. But what if something goes wrong, for example, the task depends on a file that has been renamed or moved, Internet connection interrupts when the task is being executed? The administrator may want to know about the problem. That is why Advanced Task Scheduler introduces error handling features, which allow taking actions when something wrong happens.

Logging and log files

During execution, Advanced Task Scheduler records task execution messages in a log file or sends them to an email address. Logging options can be configured in the Options section on the user’s tab of the Preferences window.

To enable logging and specify log file name: check the “Write Log File” option, in the text box next to this option enter file name of the file where you wish to record log entries. You can check the “Split Log File” option and specify maximum size for a single log file. When size of your log file reaches maximum, Advanced Task Scheduler will create new log file by adding or increasing index number in its file name.

To enable sending logs to email address: check the “Send Logs to EMail” option and specify email address and SMTP options. In Advanced Task Scheduler Professional and Network editions you can send every log message as a separate email or send a bunch of log messages in a single email once a day, week or month.

To log failed tasks only: check the “Log failed tasks only” option. This option is good for error handling. Advanced Task Scheduler will record or email log entries for failed tasks only.

Logging and log files

Conditions

In addition to error logging Advanced Task Scheduler Professional and Network editions provide more powerful error handling feature – conditions. Conditions allow executing one sequence of commands or another depending on the condition. Advanced Task Scheduler allows conditions based on error code or exit code of the program started. Error code is a code that Operating System reports when it starts the program. For example, if the program’s executable file does not exist, you’ll receive either 2 (File not found) or 3 (Path not found) error code. Error code “0” means that the program has been started successfully. Every program on Windows returns its exit code (integer value) when it finishes to execute. In general, exit code is the result of the operation that the program has been performed.

Thus, you can check last error code or last exit code of the program you started and perform different operations in case of success or failure. The example below demonstrates a task that displays message box when program fails to start. In real life, you can send an email message or use any other commands to notify yourself about the error or perform other error handling operations.

LastErrorCode conditions in Advanced Task Scheduler Professional

The example below, demonstrates how to check last exit code. The task will display a message asking user to click either “Yes” or “No” button. And will respond user by displaying different messages depending on what button has been clicked.

LastExitCode conditions in Advanced Task Scheduler Professional

Advanced error handling

If you are familiar with Perl or Python programming language, you can use the power or those programming languages by writing scripts that handling more complex conditions and operations. As Advanced Task Scheduler comes with internal portable Perl and Python interpreters, you can schedule scripts that will run from Advanced Task Scheduler on any system where Advanced Task Scheduler is installed, no need to install interpreters separately.

Categories: Task scheduler

Leave a Reply

   
About us   Privacy policy   Terms of use   Link to us
Current Version: 5.0.0.700
The following prices are based on a single order:
Basic Edition 32 and 64-bit$ 39.95 USD
Professional Edition 32 and 64-bit$ 59.95 USD
Network Edition 32 and 64-bit$ 149.95 USD
.:Testimonials

I use Advanced Task Scheduler to run my backups jobs. After performing a backup by standard Windows 2003 Server means, Advanced Task Scheduler launches a script which copies files. I am glad I chose your program.

Rob Hannigan

.:Requirements
Computer: Minimum required by operating system you are running.
Disk Space: Under 30 MB
Operating System: Microsoft Windows 32-bit or 64-bit.
Read more...