Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Cron email

General questions about VestaCP
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
ricardo777
Posts: 25
Joined: Mon Sep 30, 2013 8:42 am

Cron email
  • Quote

Post by ricardo777 » Wed Oct 02, 2013 9:06 am

Hello,

I have setup some crons, but how can I disable the email for it?

Getting spammed because the crons.
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Cron email
  • Quote

Post by skid » Wed Oct 02, 2013 11:01 am

If command return output you will get it on email. Check out if it support quite mode. If it is not, you can always suppress output by adding "> /dev/null 2>&1" to the end of command line

Code: Select all

some_commad - a arg1 -b arg2 > /dev/null 2>&1
Top

ricardo777
Posts: 25
Joined: Mon Sep 30, 2013 8:42 am

Re: Cron email
  • Quote

Post by ricardo777 » Wed Oct 02, 2013 11:18 am

skid wrote:If command return output you will get it on email. Check out if it support quite mode. If it is not, you can always suppress output by adding "> /dev/null 2>&1" to the end of command line

Code: Select all

some_commad - a arg1 -b arg2 > /dev/null 2>&1
Thank you I will try it out.
Top

websystems
Posts: 31
Joined: Wed Oct 18, 2017 6:34 am

Re: Cron email
  • Quote

Post by websystems » Thu Jun 14, 2018 9:08 pm

Hello

I came here, as I had the same problem.

I tried /dev/null 2>&1 before I started to google solution. At other servers it works, at VestaCP Centos I had problem with - it did not.

I checked user crontab using shell and I found and commented this:
#MAILTO=[email protected]
#CONTENT_TYPE="text/plain; charset=utf-8"

Now, there are no user cron emails anymore.

ANyway, if somebody knows why regular /dev/null 2>&1 does not work, please share the knowledge, as I do not like 'solutions' mentioned above.
Top

joem
Posts: 378
Joined: Thu Nov 13, 2014 8:33 am

Os: CentOS 6x
Web: nginx + php-fpm
Re: Cron email
  • Quote

Post by joem » Thu Jun 14, 2018 11:34 pm

websystems wrote: ↑
Thu Jun 14, 2018 9:08 pm
Hello

I came here, as I had the same problem.

I tried /dev/null 2>&1 before I started to google solution. At other servers it works, at VestaCP Centos I had problem with - it did not.

I checked user crontab using shell and I found and commented this:
#MAILTO=[email protected]
#CONTENT_TYPE="text/plain; charset=utf-8"

Now, there are no user cron emails anymore.

ANyway, if somebody knows why regular /dev/null 2>&1 does not work, please share the knowledge, as I do not like 'solutions' mentioned above.
you forgot > it should be

Code: Select all

> /dev/null 2>&1
Top

websystems
Posts: 31
Joined: Wed Oct 18, 2017 6:34 am

Re: Cron email
  • Quote

Post by websystems » Thu Aug 02, 2018 5:23 am

joem wrote: ↑
Thu Jun 14, 2018 11:34 pm
websystems wrote: ↑
Thu Jun 14, 2018 9:08 pm
Hello

I came here, as I had the same problem.

I tried /dev/null 2>&1 before I started to google solution. At other servers it works, at VestaCP Centos I had problem with - it did not.

I checked user crontab using shell and I found and commented this:
#MAILTO=[email protected]
#CONTENT_TYPE="text/plain; charset=utf-8"

Now, there are no user cron emails anymore.

ANyway, if somebody knows why regular /dev/null 2>&1 does not work, please share the knowledge, as I do not like 'solutions' mentioned above.
you forgot > it should be

Code: Select all

> /dev/null 2>&1

No, I did not. I just forgot it in this post. The cron entry looks like:

wget https://www.myrealdomain.com/wp-cron.ph ... processing > /dev/null 2>&1
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password