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.

Cron to Restart Services

Discussion in 'General Discussion' started by dynamicwebs, Jun 23, 2013.

  1. dynamicwebs

    dynamicwebs Member

    Joined:
    Apr 15, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Findlay, Ohio
    Wondering if someone knows how to write a cron job to restart whm services on a scheduled basis. I was just on vacation in an area of Canada that has no cellular services and over 100 miles from the nearest wifi connection point. My whm mail services froze for the entire server for 48 hours and several clients were very upset. I would love to write a cron job that would restart one or more services on a scheduled basis. Does anyone know how to do this?

    Thanks,

    Frank
     
  2. Eric

    Eric Administrator
    Staff Member

    Joined:
    Nov 25, 2007
    Messages:
    746
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    Howdy,

    It would be easy to add the lines

    @daily service exim restart
    @daily service <servicename> restart

    to your crontab as root.

    Thanks!
     
  3. kdean

    kdean Well-Known Member

    Joined:
    Oct 19, 2012
    Messages:
    262
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    Orlando, FL
    cPanel Access Level:
    Root Administrator
    Also, make sure the services like exim are checked in the Monitor column as well.

    WHM » Service Configuration » Service Manager
     
Loading...

Share This Page