- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script-mail hourly
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
03-23-2006 11:08 PM
03-23-2006 11:08 PM
Script-mail hourly
I am at one of the date centers with 5 servers of which I have to send the hourly date,uptime, sar 5 5,df -h, ./top -d 2 ---- following scripts output ------
$ more script
echo DATE
date >> sar_e
echo UPTIME >> sar_e
uptime >> sar_e
echo SAR >> sar_e
sar 5 5 >> sar_e
echo "Disk Utilization" >> sar_e
df -h >> sar_e
echo "Top" >> sar_e
./top -d 2 >> sar_e
to my bosses. Can I config. for respective 5 server so that the mail is send by it self on hourly bases betwenn 9 am to 5 pm.
Pl tell me how to config. the same
thanks in adv.
regards
wish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 11:13 PM
03-23-2006 11:13 PM
Re: Script-mail hourly
Cron cntry would look like follows.
0 9,10,11,12,13,14,15,16,17 * * * "your_scipt"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 11:16 PM
03-23-2006 11:16 PM
Re: Script-mail hourly
00 9-17 * * 1-5 /your_script
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 11:18 PM
03-23-2006 11:18 PM
Re: Script-mail hourly
create a command file and call from cron:
00 9-17 * * * /whatever/command
The last line of the command script should be something like:
mail -s"Hourly update `date +%H:%M" boss-email < sar_e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 11:20 PM
03-23-2006 11:20 PM
Re: Script-mail hourly
You may have to update your script to initialize PATH (or other env variable) variable or use full absolute path for any command used in your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 11:22 PM
03-23-2006 11:22 PM
Re: Script-mail hourly
You can use the following,
Crontab syntax :-
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
00 9-17 * * * /
-Arun