Operating System - HP-UX
1828238 Members
2203 Online
109975 Solutions
New Discussion

Automate to do system backup

 
Mousa55
Super Advisor

Automate to do system backup

Hi,

 

Required your assistance in script enhancement, we have more then 100 HP servers and we manage the backup from ignite server. currently we are backing up manually doing make net recovery. we need to configure in each server in cron job after successfull backup or failure, mail should be sent to Admin group

Can any one suggest a smart script.

Thanks

4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: Automate to do system backup

Basically you take what you already have and check the exit status.  Do you have it in a script already?

 

You will have to add to your PATH to find make_net_recovery in cron.

 

#!/usr/bin/sh

...

 

make_net_recovery ...

if [ $? -ne 0 ]; then

   status="ignite backup failed"

else

   status="ignite backup succeeded"

fi

echo "$status" | mailx -s "make_net_recovery: $status" admin.group@def.com

 

Then you create your crontab entry to select the time of day and point to the script

30 00 * * * /path_to_script.sh

 

This does it everyday at 0030.

Mousa55
Super Advisor

Re: Automate to do system backup

Hi,

 

No, i don't have any script before. i need a script to take backup automatically and send mail if backup success or failure or success with warning.

 

is this script ready to use ?

 

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

#!/usr/bin/sh

...

 

make_net_recovery ...

if [ $? -ne 0 ]; then

   status="ignite backup failed

else

   status="ignite backup failed

fi

echo "$status" | mailx -s "make_net_recovery: $status" admin.group@def.com

 

Then you create your crontab entry to select the time of day and point to the script

30 00 * * * /path_to_script.sh

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

 

Thanks for your support

James R. Ferguson
Acclaimed Contributor

Re: Automate to do system backup


@Mousa55 wrote:

No, i don't have any script before. i need a script to take backup automatically and send mail if backup success or failure or success with warning.

 

is this script ready to use ?

 


And yet your original post said you wanted a "script enhancement".  To me, that suggested that you already had *something*.   Then, after admitting that you don't you ask "is this script ready to use?" after Dennis offers a simple one.

 

What ever happened to *trying* something?  Do you want to learn to fish or to rely on others to feed you?

 

...JRF...

Dennis Handly
Acclaimed Contributor

Re: Automate to do system backup

>is this script ready to use?

 

(Oops, I just corrected some syntax errors with status=.)

 

I assumed you already know the make_net_recovery command to plunk into the script fragment.  Also you need to augment your PATH to point to the command or use an absolute path.

And any variables you get out of ~/.profile will have to be done by sourcing it in your script.

 

And of course you need to customize the mail parts.