Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> To Disable Mail For Cron Jobs, To disable mail for cron jobs
vaiharish
post Jun 22 2005, 07:09 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 22-June 05
Member No.: 5,161



HI,
any body tell me how to disable sending mail for the cron job executed?
Go to the top of the page
 
+Quote Post
shlomifr
post Jun 25 2005, 11:24 PM
Post #2


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 25-June 05
Member No.: 5,178



As far as I know, cron e-mails you only if the job writes anything to the standard output/error.
So you could redirect the output to /dev/null, and prevent cron from e-mailing you:

Example:

5 0 * * * /home/kuku/bin/my_script.sh >> /dev/null 2>&1

P.S.
====
You can alternatively, redirect the output inside the script itself:

Example:

my_script.sh:
---------------
#!/bin/sh

my_shell_command >> /dev/null 2>&1
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 09:23 PM