HPE GreenLake Administration
Operating System - HP-UX
1838576
Members
4208
Online
110128
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
12-22-2003 11:05 AM
12-22-2003 11:05 AM
Cron job
Can some1 please help me on how to write a simple cron job that will email to personA every day every hour for 30 days until it hits an errors and it can't email that person anymore...
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2003 11:41 AM
12-22-2003 11:41 AM
Re: Cron job
This doesn't really have enough information to give a good response. It would seem more likely that you would want your script to verify something and email you if there are problems, unless you are trying to write something to spam someone.
My main question is are you emailing a local user, either on the system with the cron script, or in the same buisness area of control. If so, you are going about things a little strangely and may want to think about a different approach.
Another thing is that cron is not going to stop, meaning it will continue to run as an activity/process till you remove the cron entry. Nor will it stop transmitting emails to personA if there are errors, if the mail can be sent and leave you host, then thats all she wrote... If anything you will get a "bounce-back" email replied to the sender.
Please rethink/rephrase your question a little because it really sounds like you are trying to setup a spam to annoy someone, if I am completely off base I do apologize.
My main question is are you emailing a local user, either on the system with the cron script, or in the same buisness area of control. If so, you are going about things a little strangely and may want to think about a different approach.
Another thing is that cron is not going to stop, meaning it will continue to run as an activity/process till you remove the cron entry. Nor will it stop transmitting emails to personA if there are errors, if the mail can be sent and leave you host, then thats all she wrote... If anything you will get a "bounce-back" email replied to the sender.
Please rethink/rephrase your question a little because it really sounds like you are trying to setup a spam to annoy someone, if I am completely off base I do apologize.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2003 12:15 PM
12-22-2003 12:15 PM
Re: Cron job
oh no... that is not what i am trying to accomplish
we're trying to pin point a problem that currently happen on our host. Users report that the mailx doesn't work when they run a certain applications. We have tried to use mailx to send out / receive form internal and external, and we see no problems. That is why I want to write a script to send an email of testing to a developer testign for that application every day for a week or so, so that we can prove that the mailserver is working properly...and it is their application that needs to get attention.
And that is what I am trying to do...bc i don't know how to write cron...
So.it is not what you think at all...
we're trying to pin point a problem that currently happen on our host. Users report that the mailx doesn't work when they run a certain applications. We have tried to use mailx to send out / receive form internal and external, and we see no problems. That is why I want to write a script to send an email of testing to a developer testign for that application every day for a week or so, so that we can prove that the mailserver is working properly...and it is their application that needs to get attention.
And that is what I am trying to do...bc i don't know how to write cron...
So.it is not what you think at all...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2003 12:52 PM
12-22-2003 12:52 PM
Re: Cron job
You can show every email that went out by simply reading /var/adm/syslog/mail.log where all email (incoming or outgoing) is logged. The command mailq on HP-UX will show any mail trasnsmitted but could not be completed. The user that sent the email will receive an error email if the delivery could not be completed.
If you just want to send a message every hour then the cron entry would be:
5 * * * * /usr/bin/mailx -s "test message" name@computer.com < /etc/issue
This will send the contents of the /etc/issue file to the email address name@computer.com 24 times each day forever. Any failures that bounce back will be stored in the sender's email. Any emails that are deleted along the way (*very* likely due to anti-spam filters) will not be traceable. All you can do is look at the log which is proof that the message was sent out (assuming no errors logged).
Bill Hassell, sysadmin
If you just want to send a message every hour then the cron entry would be:
5 * * * * /usr/bin/mailx -s "test message" name@computer.com < /etc/issue
This will send the contents of the /etc/issue file to the email address name@computer.com 24 times each day forever. Any failures that bounce back will be stored in the sender's email. Any emails that are deleted along the way (*very* likely due to anti-spam filters) will not be traceable. All you can do is look at the log which is proof that the message was sent out (assuming no errors logged).
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP