- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- standard redirect on SSH connect to ERR or root ma...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2009 06:45 AM
тАО11-20-2009 06:45 AM
I have:
00 6 * * * backup.ksh >> backup.log 2>&1
So bascially everything gets recorded to backup.log. But, if the ssh fails will I get notified?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2009 07:03 AM
тАО11-20-2009 07:03 AM
Re: standard redirect on SSH connect to ERR or root mail
But, if the ssh fails will I get notified?
No.
Put the notification code to send an email in backup.ksh
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2009 12:04 PM
тАО11-20-2009 12:04 PM
Re: standard redirect on SSH connect to ERR or root mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2009 10:11 AM
тАО11-21-2009 10:11 AM
SolutionIf there is a specific exit status, you can check for that.
Or you can redirect stderr in your script, use grep to scan it and then send mail from the script.
If you still want those errors to be sent to backup.log you can do:
ssh ... 2> back.err
if [ $? -eq ?? ]; then
# specific error here? send mail
fi
# scan stderr
grep -q -e "message?" back.err
if [ $? -eq 0 ]; then
# found specific errors, send mail
fi
# copy ssh stderr to script stderr
cat back.err 1>&2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2009 07:46 AM
тАО11-23-2009 07:46 AM
Re: standard redirect on SSH connect to ERR or root mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2009 09:41 PM
тАО11-23-2009 09:41 PM
Re: standard redirect on SSH connect to ERR or root mail
>cat back.err 1>&2
And of course clean up the temp file: rm -f back.err