Sponsored Content
Top Forums Shell Programming and Scripting how to capture my app starting up. Post 302155615 by parente on Friday 4th of January 2008 05:27:59 PM
Old 01-04-2008
how to capture my app starting up.

This is the script for the cold backup that we get from mycat every time it goes down and up again.
It's a huge email that we get and all within the body.

Here is the dilemma;
I would like to capture just the “”successful start up of the luminis app.””
I don't know if I need to do an “if statement “ or just get rid of the | tee -a $LOGFILE.
This back up script is running out of a cronjob once a week for the cold backup.
So what I was thinking was to take out all of the | tee -a $LOGFILE statements except for the last statement for the starting of luminis,
that way it would solve me getting the email on the body filled with the whole process as you can see in the script bellow. Once a week I get this huge email.
I want it to make sure that the backup happens, the logs get written, but that the email that I get only shows whether the startup of the application called luminis has started or failed. So what to do?
See the script bellow;;;;;

################################
# shutdown luminis
################################
/etc/init.d/luminis stop
STATUS=$?
echo "[`date`] CP Shutdown status = $STATUS" | tee -a $LOGFILE
sleep 60

echo 'Starting Luminis Backup Process...'

#change the backup directory from what's setup in .cprc for the cold backups.
LUMINIS_BACKUPS=/cpbackup-cold
export LUMINIS_BACKUPS

LOGFILE=$LUMINIS_BACKUPS/luminis_cold_backup`date +%y%m%d`.log
TARFILE=$LUMINIS_BACKUPS/luminis_cold_backup`date +%y%m%d`.tar
#
################################
# Start Backup
################################
#
echo 'TIMESTAMP: '`date` | tee -a $LOGFILE

#
###############################
# Backup CP_ROOT directory
##############################
#
echo 'Backing up luminis (CP_ROOT) directory...' | tee -a $LOGFILE
cd /opt
tar -cvf $TARFILE luminis | tee -a $LOGFILE

#
################################
# Compress tar file
################################
#
echo 'Compressing tar file' | tee -a $LOGFILE
gzip -vf $TARFILE | tee -a $LOGFILE
find $LUMINIS_BACKUPS -mtime +31 -type f -exec rm \{\} \;

################################
# startup luminis
################################
/etc/init.d/luminis start

echo 'TIMESTAMP: '`date` | tee -a $LOGFILE

Smilie
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capture the process id when starting a background process

Hello all, How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename. Any assistance is most appreciated. Thanks, Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies

2. Programming

Deadlocked App

Hello All - We have a legacy C program running non stop on one of our servers, with several instances often running at once. Fairly regularly, one of the instances while stop outputting to the log file and will just deadlock/hang. They must be then 'kill'ed by myself. When I gdb into one of... (3 Replies)
Discussion started by: markanderson
3 Replies

3. Solaris

luminis app

The guys at SunGard want to charge a lot of $$$$ for installing Luminis and we are trying to see if this can be done without them. Their installation guide provided page #53 ( http://www.luminis.nocccd.edu/documents/Luminis%20IV/lp40000in.pdf ) doesn't really tell you much. All they say is that... (4 Replies)
Discussion started by: ceci1
4 Replies

4. HP-UX

help auto starting app on boot

Hi I need a bit of help figuring out how to auto start an application on boot on an HPUX. I am a fairly exp AIX guy now working an HP shop. I use to change a /etc/rc... file. Any advise would be a great help TIA. –K If it is a help the program is a DB and runs as root /usr/ud{##}/startud... (3 Replies)
Discussion started by: KmJohnson
3 Replies

5. Red Hat

userid with nothing to do on the os/app

Hi All, I got this userid apache with the same userid and groupid and /sbin/nologin and the /www/a home folder is empty. Can I just delete this userid? How can I investigate if userid have something to do with the application? Thanks for any comment you may add. (1 Reply)
Discussion started by: itik
1 Replies

6. Shell Programming and Scripting

error situation handling when starting app from a script

Hi, in my bash script I start 3rd party app that runs quickly normally and returns some data that I use later for processing. However if there are problems the app doesn't return anything and just hangs... then my script also hangs of course, awaiting for the app to comeback. Was wondering how to... (3 Replies)
Discussion started by: TomSu
3 Replies

7. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

8. Programming

Wuhan Coronavirus Status App for China - Rapid Prototype using MQTT and the IoT OnOff IOS App

With a little bit of work, was able to build a nice "Wuhan Coronavirus Status" app using MQTT and the IoT-OnOff app. More on this technique here: ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages The result turned out nice, I think. I like the look and... (10 Replies)
Discussion started by: Neo
10 Replies
PCAP_SET_TSTAMP_TYPE(3PCAP)											       PCAP_SET_TSTAMP_TYPE(3PCAP)

NAME
pcap_set_tstamp_type - set the time stamp type to be used by a capture device SYNOPSIS
#include <pcap/pcap.h> int pcap_set_tstamp_type(pcap_t *p, int tstamp_type); DESCRIPTION
pcap_set_tstamp_type() sets the the type of time stamp desired for packets captured on the pcap descriptor to the type specified by tstamp_type. It must be called on a pcap descriptor created by pcap_create() that has not yet been activated by pcap_activate(). pcap_list_tstamp_types() will give a list of the time stamp types supported by a given capture device. See pcap-tstamp(7) for a list of all the time stamp types. RETURN VALUE
pcap_set_tstamp_type() returns 0 on success if the specified time stamp type is expected to be supported by the capture device, PCAP_WARN- ING_TSTAMP_TYPE_NOTSUP on success if the specified time stamp type is not supported by the capture device, PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated, and PCAP_ERROR_CANTSET_TSTAMP_TYPE if the capture device doesn't support setting the time stamp type. SEE ALSO
pcap(3PCAP), pcap_list_tstamp_types(3PCAP), pcap_tstamp_type_name_to_val(3PCAP), pcap-tstamp(7) 21 August 2010 PCAP_SET_TSTAMP_TYPE(3PCAP)
All times are GMT -4. The time now is 11:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy