Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sunday, 00:10 cron job?

Discussion in 'General Discussion' started by Dan Lester, Dec 7, 2017.

  1. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
    OK, I want to set up a cron job to run at 00:10am on Sunday.

    I understand I need
    "Minute" = 10
    "Hour"= 0
    "Month"= *
    "Weekday" = 0

    But what do I put in "Day"? None of the choices there correspond to what I want. If at the top in "Common Settings" I select "Once Per Week", it enters "Every Day" in the "Day" slot. Makes no sense.
     
  2. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
    The "Weekday" setting should be under "Day", and not a separate parameter.

    (I tried to edit that in to my original post, but the forum refused to accept that edit.)
     
  3. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    618
    Likes Received:
    192
    Trophy Points:
    43
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    It is a bit strange but you would use * (Every Day)

    cron.jpeg

    This will give you a 10 0 * * 0 /cron/command that should run eg:

    • 2017-12-10 00:10:00
    • 2017-12-17 00:10:00
    • 2017-12-24 00:10:00
    • 2017-12-31 00:10:00
    • 2018-01-07 00:10:00
    • etc etc
     
    #3 rpvw, Dec 7, 2017
    Last edited: Dec 7, 2017
  4. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
     
  5. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
    Thank you. Yes, that's what you get when you select for "Common Settings" --"Once Per Week". You get an implicit selection of "Every Day". I'd call that more than a bit strange. The "Weekday" selection ought to be covered under the "Day" selection. Otherwise, you end up with parameter selections that are simply contradictory.

    But I'll do what works.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The "Common Settings" in "cPanel >> Cron Jobs" are setup to support how the crond service works on the OS.

    How to run crontab job every week on Sunday

    Essentially, since crond has no weekly setting, it gives you the setting to use for "Every Sunday".

    Thank you.
     
  7. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
    Yes, that is understood. But when I select "Every Sunday" it also selects "Every Day".
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Yes, that's by design due to how crond works. It won't actually run every day, but rather "Every Day" on "Sundays" during the month.

    Thank you.
     
Loading...

Share This Page