• Hello there ??

    I’ve setup the cronjob for MainWP updatescheck to run every 2 hours

    ## mainwp check for update every 2 hours
    0 */2 * * * /usr/bin/curl --insecure https://mainwp.site.com/…/plug…/mainwp/cron/updatescheck.php > /dev/null 2>&1

    which sends me an email whenever there’s an update available on my sites. I used to get this notify email during the night but now the email gets send around noon.

    Is there somewhere an option which lets me specify the time the updates notify email gets send?

    Thanks & greetings
    Becki

Viewing 4 replies - 1 through 4 (of 4 total)
  • robwent

    (@robwent)

    Why not set the cron to only run in the night rather than every 2 hours if you only want notifications during the night?

    I would have thought this would be down to the time that the updates become available for the child sites. They would then get picked up by mainwp the next time the cron runs within the next 2 hours.

    So you could change the crons on the child sites to only check at night, or just change the mainwp cron to only check when you want to be notified.

    Thread Starter Becki Beckmann

    (@becki)

    Hello @robwent

    thanks a lot for your reply. glad to get some updates on this topic.

    Ok, for the moment changed the cron on the mainwp dashboard site to only run during the night from 0-8 every 2 hours. Let’s see if that will get the expected results?

    I also had a look at the cronjobs on the mainwp child sites and found the following which runs every hour:

    mainwp_child_cron_plugin_health_check_watcher
    mainwp_child_cron_theme_health_check_watcher

    and the following ones daily:

    mainwp_child_cron_plugin_health_check_daily
    mainwp_child_cron_theme_health_check_daily

    are these the ones responsible notifying the mainwp dashboard about the updates?

    thanks & greetings
    Becki

    robwent

    (@robwent)

    I’m not totally sure which mainwp crons on the child sites do the notifications (I’m a new user).

    I think it would depend on a few different things.

    If the cron on the child site checks for plugin updates once daily, then the main site would get notified about that within 2 hours of the child site checking to see if updates are needed.

    The cron on the child site would probably depend on 2 things, the time that the cron is set to run, and the server time that the cron would rely on to be triggered.

    It’s possible that the developers changed the cron to make the notifications arrive in the daytime, or that your server timezone has been changed (Perhaps at the same time as a recent php update).

    You can check local server time by typing ‘date’ on the command line, but I think there are also some plugins that let you modify the native wp cron jobs added by plugins and change the times and frequencies that they run.

    Thread Starter Becki Beckmann

    (@becki)

    Hello again,

    just to send an update on this topic which actually isn’t resolved yet!

    as suggested I only did the cronjob run during the night from 0-6 every 2 hours. This resulted in nothing being send for a couple of days. Once I enabled the cronjob to run 24/7 every 2 hours it took a bit and the notify email got send. This time at 12 noon ??

    also did a bit more research and found a filter which was added in mainWP 3.4

    https://mainwp.com/mainwp-3-4-additions/

    creating a tiny plugin and calling the filter also didn’t change a thing:

    add_filter( 'mainwp_updatescheck_sendmail_at_time', 'myhook_mainwp_updatescheck_sendmail_at_time', 10, 1 );
    function myhook_mainwp_updatescheck_sendmail_at_time( $hour ) {
    $hour = '12:00'; // send email notifactions after 12:00
    return $hour;
    }

    I still can’t figure out on how to specify a time when the updates notify email will get send. I would prefer to send it during the night so I recieve it in the morning and can do the updates before doing anything else …

    Currently the email get send around noon and messes with my schedule as I hate to get interrrupted when doing things. I know it’s somewhat silly but that’s how my mind works ??

    So … any help is more than appreciated

    Thanks & greetings
    Becki

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Send time of updatescheck notify email’ is closed to new replies.