Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 1992 > 9202
Listing 1 Listing 2 Listing 3 Listing 4

A Background Job Launcher

Leor Zolman

In the Premiere issue of SysAdmin, I presented a set of shell scripts that manage overnight processing of batch jobs. Those scripts, which I collectively named the "Onite" package, reduce daytime CPU load by offering users the opportunity to queue resource-intensive programs for execution during late-night hours.

Some jobs, however, are important enough that they need to be run immediately; and some programs may require immediate execution in some cases but be suitable for the overnight queue in others. A framework flexible enough to support such variations in priority would give users the option, for any particular job, of either running that job as an immediate background task or queuing it for overnight processing.

The shell scripts described are the pieces necessary to "upgrade" the Onite system to provide such a flexible framework. bgrun.sh (Listing 1) is a general-purpose background task launcher. Lines 7-9 show the usage syntax. The only required parameter, outfile, specifies the name of a file to which the standard output stream of the background script is written. If the command is run as bgrun.sh, outfile receives the standard error stream intermixed with standard output. If the command is run as bgrun2.sh (by having a link to bgrun.sh so named), then the standard error stream is not automatically redirected to outfile; instead, the invoking script is allowed to explicitly direct the standard error stream to some other file.




MarketPlace

FREE Trial Download Speeds Up Systems Now!
New Diskeeper 2008 Maximizes System Performance and Reliability�Automatically!

Instant Answers to Your IT & Business Questions
Sign Up & Get Full Access To The Definitive Online Book Collection With SkillSoft's Books24x7�.

BugSplat - Automatic Crash Analysis
Fast online exception analysis. Capture customer crash data online.

WinDev 12 - Powerful IDE
Develop 10 times faster ! ALM, IDE, .Net, RAD, 5GL, Database, 5GL, 64-bit, etc. Free Express version

Wanna see your ad here?