Welcome to Centmin Mod Community
Register Now

Mistake in auto protect cron

Discussion in 'Bug Reports' started by wmtech, Mar 27, 2018.

  1. wmtech

    wmtech Active Member

    175
    44
    28
    Jul 22, 2017
    Ratings:
    +132
    Local Time:
    11:41 AM
    There is a small mistake in autoprotect cron causing the script to run twice per day. Since I need to correct it after each install it would be fine if this can be corrected in core:

    This get's added to the cron:
    Code:
    11 */23 * * * /usr/local/src/centminmod/tools/autoprotect.sh 2>/dev/null
    This should be added:
    Code:
    11 23 * * * /usr/local/src/centminmod/tools/autoprotect.sh 2>/dev/null
    Also, even with the output redirection to /dev/null on some (most) servers I get daily e-mails after this cron has run and at some servers I don't get those e-mails. Don't know why but may I suggest to change the script to not output anything except in case of error?

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,396
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    7:41 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Actually it was deliberate to run every 23 hours. But i can see you're point. Difference of 1hr doesn't mean much. Will update 123.09beta01 in a sec. To auto update, after 123.09beta01 update, run centmin.sh once and exit and check crontab -l output for updated version.

    i.e.
    Code (Text):
    crontab -l
    0 */4 * * * /usr/bin/cminfo_updater 2>/dev/null
    13 23 * * * /usr/local/src/centminmod/tools/autoprotect.sh >/dev/null 2>&1
    
     
  3. wmtech

    wmtech Active Member

    175
    44
    28
    Jul 22, 2017
    Ratings:
    +132
    Local Time:
    11:41 AM
    Thank you!