Article
Listing 1
Listing 2
Listing 3
Listing 4
1: #
2: # Actual generalized background/overnight script driver, for
3: # generating a set of Informix reports with different parameters:
4: #
5: # The user is prompted for a printer name (printer), and a series of
6: # magazine (mag) and source code (sc) pairs. For each such pair, the
7: # report generation command:
8: # sacego -q swkpay $mag $sc | lp -d$printer
9: # is generated, and all such commands are collected in a script file
10: # named $list.
11: #
12: # Finally, this script file is submitted to either spoolonite.sh or
13: # bgrun.sh, as specified by the user.
14: #
15:
16: echo
17: echo Reports of Subscription Payment History by Source Code
18: echo
19:
20: debug=Y # to support testing
21:
22: AppId=orig # AppId is short description of application
23: Ltmp=/u3/Srcrep/Ltmp # Work/Log area for the app, publicly writeable
24: UseLock=Y # Y to use lockfiles, N not to
25:
26: if [ $UseLock = Y ]; then
27: LOCKFILE=$Ltmp/$AppId.LOCK # Name of lockfile
28: LOCKOPT="-l $LOCKFILE" # bgrun.sh lockfile option
29: fi
30:
31: onite=`ask.sh "Do you want to run these reports overnight"` # get Y/N
32:
33: if [ $onite = N ]; then # If requesting background execution,
34: if [ $UseLock = Y ]; then # and using a lock file,
35: if [ -r $LOCKFILE ]; then # then check for lock file
36: echo "\nSorry, a related report is running.
|