- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to set up a mailx of report
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
тАО02-28-2003 07:37 AM
тАО02-28-2003 07:37 AM
how to set up a mailx of report
I need to get a report which is generated from an awk script to be sent out once a day to various users.
what do you suggest I was thinking of setting up a script, then simply getting crontab to run it at a certain time
thanks for any suggestions
bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2003 07:42 AM
тАО02-28-2003 07:42 AM
Re: how to set up a mailx of report
Sounds good to me. Remember that any output generated by a cron job is mailed to the user under which the cronjob runs, so make sure you capture all output if you want to prevent this happening, or redirect to /dev/null, e.g.:
0 0 * * * yourscript >/dev/null 2>&1
I'd put all the mail commands within your script rather than on the cron line.
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2003 07:46 AM
тАО02-28-2003 07:46 AM
Re: how to set up a mailx of report
stick that in cron and it will mail all output from the script in the body of the script.
attached, production mailfile script will let you email a file(report output to disk) as an attachement to anyone you want.
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
тАО02-28-2003 01:13 PM
тАО02-28-2003 01:13 PM
Re: how to set up a mailx of report
Another way of doing it if you don't want all the output from the cron job mailed:
scriptname >2&1
.
.
.
in your script:
report > report.txt
elm -s"subject" whoever@wherever.com
hth
Randy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2003 01:24 PM
тАО02-28-2003 01:24 PM
Re: how to set up a mailx of report
Since you are going to send it to multiple users, make your script look like
//
USERS="user1@yourdomain.com user2@yourdomain.com user3@yourdomain.com"
your_awkscript
cat report |mailx -s "Awk report" $USERS
//
Then put it in the cronjob as mentioned by others.
-Sri