Jump to content

Recommended Posts

Posted

Is there some way to surpress output from a cron being emailed to you ? I want the output from other crons to be emailed just not from one, is that possible ? I have tried adding

 

>-silent

 

at the end but it makes no difference

 

Thanks

Posted

Cron jobs only generate email when there's output from the process. The best way is to create the process that is being run in cron to only output errors. (Note: this is true for running programs in Linux and most Unixes in general, not just from cron.)

 

If that's not possible, you can redirect regular output (and only get emails on error output) using the following format:

>program > /dev/null

 

This redirects (>) standard output to a null device (/dev/null), which means it supresses it.

 

If you want to suppress all output including errors:

>program > /dev/null 2>&1

 

This has the addition of redirecting standard error (2) to standard output (1) which is being redirected to a null device (/dev/null), therefore suppressing both errors and regular output.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...