Paper Lantern for cPanel accounts is being retired this year. Find out more »
cPanel & WHM Version 102 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

WHM (root) CRON Jobs

David K. Lynn shared this idea 6 years ago
Open Discussion

root-owned CRON jobs must currently be entered via shell commands. Because the WHM is the master of one or more cPanel accounts, it makes sense for WHM to be able to run a CRON job across its associated accounts (as a Multi-Account Function).

My immediate use:

A few years ago, I created a PHP script which created hash values for each of my executable files (.php, .js, htm(l), etc.) and storee them in a database along with the path-to-filename (for each account). A daily CRON (in each account) determined which files were added, edited or deleted and any changes were e-mailed to me.

I was recently contacted regarding expanding the capability of that script and expanding the database to record every (hourly) change (I made that table self-deleting for records over 30 days old) and run the script(s) via CRON hourly (only 0.75 sec on the account I used for testing) with a daily report summarizing the changes (or lack thereof) over the previous 24 hours.

Combining the cPanel scripts and running CRON as root would make life simpler as the scans could be forced to run serially and I would only receive an hourly report if there were any changes (i.e., a hack-attack alert) and daily for "that warm, fuzzy feeling."

I have also been asked about a script to look at incoming e-mail (for "user does not exist" messages for a newsletter) and believe that the same technology can be used to identify SPAM IP addresses, subjects and keywords which could be used to create a ban list (to supplement SpamAssassin).

The possibilities which could be opened by a WHM (root) CRON feature could expand rapidly.

Replies (1)


We'd like to keep more than one month of access logs in user's home directory.

Whatever pruning method we use, a root cron job would be the key, and since this is (likely) a common use, why not make the crontab editing easier and less risky, with a WHM interface?

Leave a Comment
Attach a file