Jump to content

CRON e-mails every 5-minutes


Recommended Posts

After upgrading to WHMCS 7 I increased the CRON frequency to 5 minutes as suggested by the Upgrade Instructions.

 

I now receive this e-mail every 5 minutes:

 

The cron has run within the last 24 hours.

To force the cron to run all operations immediately,

please invoke with the following arguments "all --force".

 

I thought maybe I was somehow running an old copy of cron.php, but opening it shows the correct 7.0 version:

 

<?php //00ee8

// *************************************************************************

// * *

// * WHMCS - The Complete Client Management, Billing & Support Solution *

// * Copyright © WHMCS Ltd. All Rights Reserved, *

// * Version: 7.0.0 (7.0.0-release.1) *

// * BuildId: 98feebc.78 *

// * Build Date: 02 Oct 2016 *

// * *

 

All other files in the crons folder also have the 7.0 header.

 

Did I overlook something? Or are these e-mails every 5 minutes expected?

Link to comment
Share on other sites

  • WHMCS Technical Analyst

WHMCS itself will email a report to you whenever the cron performs any actions so you don't need to provide an email address in your cron configuration at the server level. By removing your email from there, that will stop these notifications you are receiving every time the cron file is invoked. Alternatively, add the following to the end of your cron command to ignore the output: > /dev/null 2>&1

 

-Eddy

Link to comment
Share on other sites

The CRON process e-mails all messages outputted by CRON jobs to notify the administrator of possible errors. Your "hack" suppresses this very important feature. If the WHMCS cron.php experiences an error and fails to e-mail me about it, I will never know about it when I use your suggestion.

 

I hope you will reconsider this for a future version. The unwritten but well-known rule is that a cron job runs quietly, and outputs only when it needs to notify the administrator.

Link to comment
Share on other sites

Any solutions for this?

 

Alternatively, add the following to the end of your cron command to ignore the output: > /dev/null 2>&1

 

There's your solution. Right there

Something like

curl https://domain.com/crons/cron.php  > /dev/null 2>&1

 

OR, if you have ssh access, just edit the cron manually and add

 

MAILTO=""

at the top of the file.

Link to comment
Share on other sites

Another thing that WHMCS didn't thing before implementing in v7.

 

I do not want to disable the cron emails. I actually want to receive them, because they are send to a proper system administrator that checks for errors and logs without WHMCS access.

 

This is done once a day today, but WHMCS suggest to change the cron to every 5 minutes with v7.

 

So its either disable the email feature or get spammed every 5 minutes.

 

The more I'm reading the forums, the more suggestions everywhere to disable things in order to get them to work. This does not seem like an upgrade but a downgrade if you start losing functionality.

Link to comment
Share on other sites

This does not seem like an upgrade but a downgrade if you start losing functionality.

I disagree, but you are welcome to your own opinion.

 

Having a system cron running every 5mins will allow WHMCS to run other maintenance tasks in future version at times you choose in WHMCS. This means apart from this single 5min cronjob, everything else can be scheduled in WHMCS. You will receive emails from WHMCS so you're not missing out on anything by disabling the email notification on your server for this cron. And further, if you are worried about email reliability, use a proper SMTP service for your WHMCS emails, I use Postmark at the moment, but you have many choices.

Link to comment
Share on other sites

Hey Brad, I hear you.

You hear Brad, but not the others?

Maybe I misread, but Brad is agreeing with 5 minute crons and suppressing warnings is a good idea. That's the default recommendation from WHMCS, so passing *that* to them is validating that choice they'd made. Others, myself included, would prefer to have the cron emails available to monitor failures in the cron daemon, which WHMCS is unlikely to report back to us since it, well, failed.

Link to comment
Share on other sites

  • 2 weeks later...
You hear Brad, but not the others?

Maybe I misread, but Brad is agreeing with 5 minute crons and suppressing warnings is a good idea. That's the default recommendation from WHMCS, so passing *that* to them is validating that choice they'd made. Others, myself included, would prefer to have the cron emails available to monitor failures in the cron daemon, which WHMCS is unlikely to report back to us since it, well, failed.

 

Agreed.

 

Cron emails prior to v7 were actually really useful. They contained things that we needed to act on like the failure of automatic account suspensions, cancellations, terminations, failed card payments and so on. It sounds like if we still want to get the useful cron emails we also need to put up with the junk emails every 5 minutes!

Link to comment
Share on other sites

The "cron emails" as you call them (the ones sent via WHMCS) are still sent only daily despite the 5 min cron being needed. You should receive no more or less emails than you currently receive if this is setup the way WHMCS suggests.

 

WHMCS don't suggest adding /dev/null to the cron job in any of their documentation:

 

http://docs.whmcs.com/Cron_Tasks#System_Cron_Frequency

 

Nor is it mentioned in any of the v7 release notes.

 

Versions prior to 7 didn't require this, so anyone upgrading to v7 is going to be receiving emails every 5 mins. At the very least WHMCS need to update their documentation to let users know they'll need to modify their cron job to disable the email output.

Link to comment
Share on other sites

You are in the web hosting business, I'm sure you are quite capable of configuring your own cronjobs. It's your choice to receive emails from your server whenever the cronjob runs, but WHMCS will still only send you the same amount of emails it used to send you on precious versions.

Link to comment
Share on other sites

  • 2 weeks later...

I'm having the same issue with the cron, it just returns

The cron has run within the last 24 hours.

To force the cron to run all operations immediately,

please invoke with the following arguments "all --force".

 

And nothing is actually done. No invoices are processed or generated. If however, I run it manually using all --force at the end, everything runs correctly.

Link to comment
Share on other sites

Hi ScritOTara,

 

Thanks for your post on the community forums.

 

The message you are seeing indicates that the cron has run once per day, if you look under Setup -> Automation Settings -> Time of Day to see what time your cron runs then, check the email account where your control panel sends your cron emails to to see what the report shows at that time of the day.

Link to comment
Share on other sites

Hi Everyone,

 

I'm pleased to advise that in Version 7.1 currently in beta we've made some changes to the Cron Output based on feedback from users like yourself.

 

I can confirm that we will no longer output the following message when the cron runs:

 

The cron has run within the last 24 hours.

To force the cron to run all operations immediately,

please invoke with the following arguments "all --force".

 

You will however continue to receive notifications when your daily cron job runs and in instances where the cron outputs an error. Until 7.1 goes General Release we continue to recommend adding > /dev/null 2>&1 to the end of your cron job this will suppress the output you receive when the cron has nothing to do.

 

We really do appriciate the feedback that you have provided around the cron and look forward to having you check out WHMCS v7.1 soon you can read more in the Blog & Release Notes

Link to comment
Share on other sites

  • 1 month later...

Hi Chris, I am running 7.1 and i still get this error

 

The cron has run within the last 24 hours.

To force the cron to run all operations immediately, please invoke with the following arguments "all --force".

Perform WHMCS Update Check

Check for Updates: No new updates available

 

- - - Updated - - -

 

I am also curious why do we need to run cron every 5 minutes, I dont understand the necessity or advantage besides all these new useless emails we get everytime it runs?

Link to comment
Share on other sites

Hello John,

 

WHMCS v7.1 shouldn't send these notification please upload a fresh copy of the crons directory to see if this helps.

 

The new cron performs tasks in the background such as Ticket Escalations this table shows when everything runs http://docs.whmcs.com/Crons#Task_Options_for_skip_.26_do

 

You can run it less frequently if you prefer, i'm sure that we'll adding more to the cron over time as well.

Link to comment
Share on other sites

Join the conversation

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

Guest
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated