[HPADM] Re: Sending "nohup"-ed scripts output to a log file

From: bill.thompson@goodyear.com
Date: Thu Jan 22 2004 - 15:13:53 EST


One way is to replace nohup with at:

   at now <<END_OF_AT
   #
   # Synch BKP
   #
   cd /usr/bcv/logs
   ksh -x /usr/bcv/scripts/bcv_ops.ksh bkp_tp sync >bkp_tp.log 2>&1 &
   ksh -x /usr/bcv/scripts/bcv_ops.ksh bkp_db sync >bkp_db.log 2>&1 &
   ksh -x /usr/bcv/scripts/bcv_ops.ksh bkp_al sync >bkp_al.log 2>&1 &
   #
   # Synch RPT
   #
   ksh -x /usr/bcv/scripts/bcv_ops.ksh rpt_tp sync >rpt_tp.log 2>&1 &
   ksh -x /usr/bcv/scripts/bcv_ops.ksh rpt_db sync >rpt_db.log 2>&1 &
   ksh -x /usr/bcv/scripts/bcv_ops.ksh rpt_al sync >rpt_al.log 2>&1 &

   END_OF_AT

Just make sure the user running the script has at rights
(/var/adm/cron/at.allow)
                                                                     
 Bill Thompson
 Sr UNIX Systems Administrator
 The Goodyear Tire & Rubber Company
 6-0599
                                                                     
 Contains Confidential and/or Proprietary Information.
 May Not Be Copied or Disseminated Without Express Consent of The
 Goodyear Tire & Rubber Company.
                                                                     

|---------+------------------------------>
| | "Abramson, Stuart" |
| | <SAbramson@Wabtec.c|
| | om> |
| | Sent by: |
| | hpux-admin-owner@Du|
| | tchWorks.nl |
| | |
| | |
| | 01/22/2004 02:57 PM|
| | |
|---------+------------------------------>
>-------------------------------------------------------------------------------------------------------------|
  | |
  | To: "Hpux-Admin (hpux-admin@dutchworks.nl)" <hpux-admin@dutchworks.nl> |
  | cc: (bcc: Bill Thompson Jr./NA/GDYR) |
  | Subject: [HPADM] Sending "nohup"-ed scripts output to a log file |
>-------------------------------------------------------------------------------------------------------------|

Hpux-admins:

We run scripts that have "nohup"s in them from cronjobs:

            #
            # Start concurrent syncs of both RPT and BKP instances..
            #

            #
            # Synch BKP
            #
            cd /usr/bcv/logs
            nohup ksh -x /usr/bcv/scripts/bcv_ops.ksh bkp_tp sync &
            nohup ksh -x /usr/bcv/scripts/bcv_ops.ksh bkp_db sync &
            nohup ksh -x /usr/bcv/scripts/bcv_ops.ksh bkp_al sync &
            #
            # Synch RPT
            #
            nohup ksh -x /usr/bcv/scripts/bcv_ops.ksh rpt_tp sync &
            nohup ksh -x /usr/bcv/scripts/bcv_ops.ksh rpt_db sync &
            nohup ksh -x /usr/bcv/scripts/bcv_ops.ksh rpt_al sync &

They can all run together, we don't care, in the background.

But the output goes to "nohup.out" and it's all mixed up for 6 scripts in
the same file.

What can I do to get each nohup-ed script to write to a different file,
nohup.XXX, for example.

        Stuart

Stuart Abramson | WABTEC Corp. | Wilmerding, PA
Off: 412/825-1434 | Cell: 412/417-1567 | email: sabramson@wabtec.com

***** CONFIDENTIALITY NOTE *****
The content contained in this e-mail transmission is legally privileged and
confidential information intended only for the use of the individual or
entity named herein. If the reader of this transmission is not the intended
recipient, you are hereby notified that any dissemination, distribution, or
copying of this transmission is strictly prohibited.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:38 EDT