1832869 Members
6838 Online
110048 Solutions
New Discussion

Re: Ignite Backup Script

 
itrc55
Regular Advisor

Ignite Backup Script

Hi,

I have 173 HP-UX servers, currently i am taking backup using cron job, but unfortunately i don't know if os backup taken successfully or no, for that i need your support to provide me with simple script to send me mail after backup done in these three status

backup success
failure
success with warning

Thanks

8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: Ignite Backup Script

>script to send me mail after backup done in these three status

 

Are these well defined exit status codes?  Or do you need to scan stderr?

Bill Hassell
Honored Contributor

Re: Ignite Backup Script

Ignite has 3 separate return codes:

 

           0    No warnings or failures occurred; the execution completed successfully.
           1    A failure occurred.
           2    A warning occurred.

 

Now a warning may be a problem with the system itself (unmounted filesystems, bad filenames, etc) which creates a backup but a subsequent restore may have some issues. So each non-zero return needs to be investigated. I wrote the enclosed script to simplify the task and to also log the results to syslog (using facility local2). This script can optionally email the results when there is a failure/warning, or add -v and success will also be emailed. You can create a separate logfile for local by adding local2.none



Bill Hassell, sysadmin
itrc55
Regular Advisor

Re: Ignite Backup Script

Hi,

 

Thanks Mr. for your support, But can you tell me what is the things you want me to edit in this script ? if the ignite server IP is 15.0.18.63 and e-mai is test@abc.com and only need VG00 for backup.

 

where i edit the script like below

mnr -s 15.0.18.63 -e test@abc.com -n 2 -p -v

 

and when i run the script i facing these message

 

#./mnr.sh

-s <server> is required
=======================

Usage: mnr -s 15.0.18.63 -e test@abc.com -n 2 -p -v
where:
-s = Ignite server hostname or IP address (required)
-e = email address for notifications
-n <qty> = number of archives to keep - default=2
-p = run command in preview mode
-v = verbose (email for success too)
-x = directories to be excluded from vg00

Logs results to /var/adm/mnr.log, notice to syslog (local2)

 

 

please your support thanks.

Bill Hassell
Honored Contributor

Re: Ignite Backup Script

There is nothing to edit in the script. However, the script tries to validate the IP address or hostname. You can trace the program to see the test:

 

    TRACEME=1 mnr -s 15.0.18.63 -e test@abc.com -n 2 -p -v

 

The error indicates that the IP address did not get parsed. I have tried to duplicate your error but cannot get the error message (which occurs when -z $IGNITESERVER is true). In other words, the variable is testing as zero length. Post the results of the TRACME comand line.



Bill Hassell, sysadmin
itrc55
Regular Advisor

Re: Ignite Backup Script

Hi,

 

Thanks for your response, but can you send me the line number on this scripts you should me fill it with server IP and email and excluded filesystem.

 

Because I fill one line # 28, and this is the output of trace command

 

 

#ll
total 96
-rw-r--r--   1 root       sys              5 Jun 19 08:45  9999
-rwxr-xr-x   1 root       sys           1824 Jun 18 11:54 ignite-tmp.sh
-rwxr-xr-x   1 root       sys           1806 Jun 19 13:41 ignite.sh
-rwxr-xr-x   1 root       sys           6394 Jun 20 09:13 mnr.sh
-rw-r--r--   1 root       sys             35 Jun 18 15:19 test
-rwxr-xr-x   1 root       sys           1263 Jun 19 09:06 test.sh


 

# TRACEME=1 mnr -s 15.0.18.63 -e test@abc.com -n 2 -p -v
sh: mnr:  not found.


# TRACEME=1 mnr.sh -s 15.0.18.63 -e test@abc.com -n 2 -p -v
sh: mnr.sh:  not found.

 

Thanks again

Dennis Handly
Acclaimed Contributor

Re: Ignite Backup Script

>-rwxr-xr-x   1 root       sys   mnr.sh
># TRACEME=1 mnr.sh -s 15.0.18.63 -e test@abc.com -n 2 -p -v
>sh: mnr.sh:  not found.

 

This is probably shells 101.  Since "." isn't in $PATH, you need to use "./":

TRACEME=1 ./mnr.sh -s 15.0.18.63 -e test@abc.com -n 2 -p -v

 

itrc55
Regular Advisor

Re: Ignite Backup Script

Hi,

 

check the output of TRACEME command on the attached file.

 

and still i facing the same issue when i try to run this script

 

#./mnr.sh

-s <server> is required

=======================

Usage: mnr -s <15.0.18.63> [-e test@abc.com] -p -v -x exclude=/u02
where:
-s = Ignite server hostname or IP address (required)
-e = email address for notifications
-n <qty> = number of archives to keep - default=2
-p = run command in preview mode
-v = verbose (email for success too)
-x = directories to be excluded from vg00

Logs results to /var/adm/mnr.log, notice to syslog (local2)

 

Note: i added my server IP and my mail on this line (28) on the script, please tell me if i need to edit other line.

 

Usage: mnr -s <15.0.18.63> [-e test@abc.com] [-n <qty>] [-p] [-v] [-x exclude=/u02]

 

Thanks

 

Bill Hassell
Honored Contributor

Re: Ignite Backup Script

I'm a bit confused. The trace output shows that the script ran just fine.

Your example in red seems to indicate that you entered nothing on the command line:

 

#./mnr.sh

-s <server> is required

 

This script is not interactive, it requires command line parameters.

It is designed to be used in batch mode such as a cron job.



Bill Hassell, sysadmin