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.

Script to check cron jobs

Discussion in 'General Discussion' started by thewebhosting, Sep 18, 2009.

  1. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    We allow our users to run their custom cron jobs on our shared server not more than 5 times a day. It is difficult for us to check each users cron jobs manually since there are hundreds of domains are hosted.

    I was just wondering if there is any script available that can notify admin directly how many times users are running their cron jobs a day?

    Thanks!
     
  2. MattCurry

    MattCurry Well-Known Member

    Joined:
    Aug 18, 2009
    Messages:
    275
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Houston, Tx
    Scripts to check Crong Jobs

    Hello,

    I do apologize for your issue, however I can say that we dont have a script that would do that by default. I am not saying it is not possible, we just do not have a scripts that would do that out of the box. Please let me know if you have any other questions.

    Thank you,
    Matthew Curry
     
  3. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    You just acknowledged that you can't routinely check user cron scripts for something as simple as their time settings let alone something more complex such as what they are actually running and just as a note to you, cronjob access is the same thing as allowing full unrestricted SSH access!

    If you do not follow my less than subtle point, you have a lot more to worry about than just the "time" settings of your user's cronjobs and even with the capacity to monitor things closely (which you clearly don't have setup), I still would not recommend allowing users access to setup their own cronjobs just because of the enormous security issues involved!

    Now regarding your specific question ....

    Setting up a cronjob to monitor the cronjob settings is a piece of cake and generally only takes me about 5 minutes to write from scratch to run basic checks against the crontab time settings for all users. All you really need to do is read all the crontab user files and run a quick check of the time settings for each line and disable or override the settings of those that don't meet programmed limit guidelines ---- simple grep and sed replaces will work! ;)
     
Loading...

Share This Page