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
Article Listing 1 Listing 3 Listing 4

Listing 2

1: #
2: # Template driver script for background job
3: #
4:
5: debug=Y                     # to support testing
6:
7: AppId=report                # AppId is short description of application
8: Ltmp=/tmp                   # Work/Log area for the app, publicly writeable
9: UseLock=Y                   # Y to use lockfiles, N not to
10:
11: [ $UseLock = Y ] && LOCKFILE=$Ltmp/$AppId.LOCK  # Name of lockfile
12:
13: echo                        # Announce the nature of the application
14: echo (Name of report)
15: echo
16:
17: if [ $UseLock = Y -a -f $LOCKFILE ]; then       # check for lock file
18:     echo "\nSorry, a related report is running. Please try again later."
19:     exit 1
20: fi
21:
22: if [ $UseLock = Y ]; then                       # Prevent zombie lock file if
23:     trap "rm $LOCKFILE; exit 1" 1 2 3 9 14 15   # user interrupts this script
24:     touch $LOCKFILE                             # Create the lockfile
25: fi
26:
27: if [ $debug = Y ]
28: then                                    # If debugging, create output file
29:     outlog=$AppId.out                   # in the current directory
30: else
31:     outlog=/Ltmp/$AppId.log             # else create in the standard place
32: fi
33:
34: bgrun.sh $outlog <<END
35: #   *** insert command here ***
36:     [ $UseLock = Y ] && rm $LOCKFILE
37: END
38:
39: # alternate form, if a script file has been created as $script:
40: # bgrun.s

				  



MarketPlace

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

NEW! Numara FootPrints 9 - Service Desk Management
IT Service Management that Delivers. Real Value. Real Flexibility. Real Results. Free Demo.

Online Crash Analysis
Automatically capture customer crash data, no debugger required. Support for .NET, C++, OS X, Java.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Wanna see your ad here?