- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron settings
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
Forums
Discussions
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
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
08-07-2002 12:15 AM
08-07-2002 12:15 AM
I want to prevent the cron from sending e-mail to the root users when ever activating a cron scheduled job.
Thanks guys
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2002 12:22 AM
08-07-2002 12:22 AM
Re: Cron settings
cron will mail any output to the user that invoked it, so you need to make sure your cronjob produces no output. Either redirect the stdout + stderr to /dev/null or a log file on the cron line itself, or, if you're calling a script, within the script itself.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2002 12:23 AM
08-07-2002 12:23 AM
Solutionm h D M W /some/cron/script >/dev/null 2>&1
where m = minute, h-hour, D=day, M=month, W=days of week. The 2>&1 will redirect stderr to stdout and >/dev/null will direct stdout to /dev/null. Hope this helps.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2002 07:23 AM
08-07-2002 07:23 AM
Re: Cron settings
Sample crontab entry -
0 19 * * * /opt/apps/jobprod/backup/jdaprod_splitb
c/jdaprod_splitbc >/dev/null 2>&1
Best of luck.
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2002 07:32 AM
08-07-2002 07:32 AM
Re: Cron settings
The correct order, as shown in earlier replies, is:
> /dev/null 2>&1
You must first redirect stdout, and THEN redirect stderr to stdout. Real easy to get it backwards, and then wonder why it doesn't work...
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2002 02:38 AM
08-08-2002 02:38 AM
Re: Cron settings
I wrote the syntax wrong before.
Now It's working!
Thanks