1826415 Members
3943 Online
109692 Solutions
New Discussion

Mail from SAM Backup

 
SOLVED
Go to solution
Guy Humphreys
Valued Contributor

Mail from SAM Backup

Hi All,

I have a 10.20 machine that runs a SAM created backup everynight. It used to just email root with the results upon completion but now we want it to email to an internet address.

I have altered the file:

/var/spool/cron/crontabs/root so that instead of it going to root only it goes to:
helpdesk@mycomp.com,root

However, the internet address never receives the mail but the usual local root mailbox does. If I do a manual:

mailx -s "subject line" helpdesk@mycomp.com,root < /somefile

both recipients get the mail OK, so I know sendmail is working OK

Does anyone have clue why it is behaving oddly, or a workaround perhaps

Thanks a lot
Guy
'If it ain't broke, don't fix it!'
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: Mail from SAM Backup

This methodology works for me.

change
mailx -s "subject line" helpdesk@mycomp.com,root < /somefile

to

/somefile 2>&1 | mailx -s "subject line" helpdesk@mycomp.com,root

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
RAC_1
Honored Contributor

Re: Mail from SAM Backup

mailx -s "subject line" helpdesk@mycomp.com,root < /somefile

should work. Does the email for helpdesk sits in mailq? What do you get in mail.log?

You can try as follows.
echo "some_file"|mailx -s "" helpdesk@mycomp.com, root

Anil
There is no substitute to HARDWORK
Guy Humphreys
Valued Contributor

Re: Mail from SAM Backup

Thanks for the quick responses guys, however I don't think I have explained myself properly.

The mailx command I mention above works for me, I only used it to check that sendmail was working. What is NOT working is the sam backup email notification. the backup is triggered from cron as below:

00 1 * * * /usr/sam/lbin/br_backup MAG FULL Y /dev/rmt/1m /etc/sam/br/graphXBAa12086 helpdesk@comp.com,root Y 1 N > /var/tmp/SAM_br_msgs 2>&1 #sambackup

the fbackup jobs runs and emails the results to root but does not email them to the internet address helpdesk@comp.com

When you suggest altering my mailx line do you mean the script within br_backup? I am reticent to go 'mucking' about with this HP script (unless of course there is no other course of action)

Thanks again
Guy
'If it ain't broke, don't fix it!'
John Kelly_3
Regular Advisor

Re: Mail from SAM Backup

The root mail you receive is where cron sends the job's output - so just redirect all output from the cron job to a mail to your helpdesk account. E.g.

00 22 * * * /sam/backupcommand > /usr/bin/mailx -s "Backup report" helpdesk@mail.com 2>&1
John Kelly_3
Regular Advisor

Re: Mail from SAM Backup

Sorry, that should be a | not a >
E.g.
00 22 * * * /sam/backupcommand | /usr/bin/mailx -s "Backup report" helpdesk@mail.com 2>&1
Guy Humphreys
Valued Contributor

Re: Mail from SAM Backup

Thanks for the quick replies guys, Sorry this msg is so late, I have been working on other things.

Have not managed to implement your suggestions as the problem seems to have disappeared on its own!!! Issue must have been elsewhere.

Cheers
Guy
'If it ain't broke, don't fix it!'
Darren Prior
Honored Contributor

Re: Mail from SAM Backup

Hi Guy,

The br_backup script states that the argument $6 is for the user that should be sent email, rather than a list of users. You could modify the script, as you are aware it would no longer be supported by HP - and it's possible that patching could overwrite your changes.

regards,

Darren.
Calm down. It's only ones and zeros...
Guy Humphreys
Valued Contributor

Re: Mail from SAM Backup

I think I have it, did not realise that argument $6 could only have one user and not a list - Thanks for pointing that out Darren.

How about I use an alias instead? Think that should work

Cheers
Guy
'If it ain't broke, don't fix it!'
Darren Prior
Honored Contributor

Re: Mail from SAM Backup

Yes - that sounds a better solution. You could probably rewrite the script to cope with a list, but the alias idea is neater. Once you start modifying system scripts it can be pretty easy to forget just which ones have changed!

regards,

Darren.
Calm down. It's only ones and zeros...
Tapas Jha
Valued Contributor
Solution

Re: Mail from SAM Backup

Hi,

Just looking your mail it seems everything is perfect except the cron file you have modified. I think you have manually modified the cron. Either Do crontab -e or restart the cron. If you do manually modification then cron will take previous one.

Rgds
Tapas
Tapas Jha