- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Scripted report via email
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
Forums
Discussions
Discussions
Discussions
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
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
06-28-2001 01:25 PM
06-28-2001 01:25 PM
cd /home/reports
touch bdf.txt
date > bdf.txt
bdf >> bdf.txt
elm -s "bdf Report" root < bdf.txt
rm bdf.txt
This works fine until I try to run it via cron., as it returns the status lines:
sending mail
mail sent!
When it does this, cron doesn't like it and generates an error.
So... how do I get around this? Is there a script command to read the responses or is there a better way?
Many Thanks,
Doug
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2001 01:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2001 01:51 PM
06-28-2001 01:51 PM
Re: Scripted report via email
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2001 01:55 PM
06-28-2001 01:55 PM
Re: Scripted report via email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2001 02:17 PM
06-28-2001 02:17 PM
Re: Scripted report via email
I have a script that does a bdf and some other things that I like to keep track of on a daily basic. Below is the script and my cron entry.
=====
dailyfile=/home/root/dailychanges
echo "Daily Changes / `uname -n` / `date`" > $dailyfile
echo "" >> $dailyfile
echo "BDF" >> $dailyfile
bdf |grep vg00|awk '{print $5 " " $6}' >> $dailyfile
echo "" >> $dailyfile
echo "" >> $dailyfile
netstat -rn >> $dailyfile
echo "" >> $dailyfile
echo "" >> $dailyfile
echo "Netconf" >> $dailyfile
cat /etc/rc.config.d/netconf |grep -i IP_ADDRESS |grep -v '#' >> $dailyfile
cat /etc/rc.config.d/netconf |grep -i INTERFACE_NAME |grep -v '#' >> $dailyfile
echo "" >> $dailyfile
echo "" >> $dailyfile
echo "Uptime" >> $dailyfile
uptime >> $dailyfile
cat $dailyfile | mailx -s "Daily Changes Report for `uname -n`" YOU@YOURDOMAIN.com
=====
Here is my entry in cron.
=====
# script checks for daily changes
0 20 * * * sh /home/root/daily_changes.sh
=====
-Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2001 05:28 AM
06-29-2001 05:28 AM
Re: Scripted report via email
'mailx -s "bdf Report" root < bdf.txt '
command as suggested by James.
Also thanks to Clay & Jason for your help as well.
Doug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2001 05:30 AM
06-29-2001 05:30 AM
Re: Scripted report via email
OK, a better answer to your question:
I assume that you are being bothered by the additional mailing (by cron) announcing "Cron: The previous message is the standard output
and standard error of one of your crontab commands" when you use 'elm'.
You can circumvent this in one of several ways:
1. Use 'mailx' as I first suggested, since it doesn't write "mail sent!" and cause 'cron' to "complain".
2. Use 'elm' exactly as you have been doing, but construct your cron entry along this line:
# * * * * * /thescript > dev/null 2>&1
or, make your script's statement like this:
# elm -s "bdf Report" root < bdf.txt > /dev/null 2>&1
...JRF...