1833883 Members
1840 Online
110063 Solutions
New Discussion

Re: logging in ksh

 
Ratzie
Super Advisor

logging in ksh

I am writing a script that is being executed by roots crontab and sends the output to a log.

0 0 * * 6 su back -c /home/back/scripts/backup/backup_db.sh > /home/back/log/backup_db.log.`date +\%j`

My problem is is that the script is in ksh, this script call 3 other scripts.

I would like to have all the output emailed to me, (and later, only email if I get an error from any of the scripts that ran).
How do I set logging in backup_db.sh and at the end mail the file.

I am sure there is a better way to do this, but any help would be appreciated.

All the scripts are done in ksh, yes, I would like to go to perl, but, not at this time...
2 REPLIES 2
Sridhar Bhaskarla
Honored Contributor

Re: logging in ksh

Hi,

Looks like this is a duplicate thread to

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=385966

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Schulte zur Sur
Honored Contributor

Re: logging in ksh

Hi,

as it is now, since you do not redirect stderr, you should get any error messages in an email. Should the scripts cause no errors, you shouldn't get a mail. Who is me, root? Of course you can redirect any output of any command in the scripts to file and later check on, if something is in there and mail it.

greetings,

Michael