Cron PHP job as ROOT


I tried to make a Cron Job for a PHP script.

I have created a PHP script for compile stats about QUOTA. This script require the ROOT privileges to run.

When I test the script from ‘Schedules Cron Jobs’ section with ‘Run Now’ command, all work fine.
When the cron job run the command, the script have error because is not in ROOT.
I have added ‘root’ in the value for ‘Execute cron job as’.

The file is root owner (user and group) and have chmod +x.

I tried few change and is suggest I have fixed the problem;

  • add ‘-q’ to php command
  • add full path for each command (env vars is missing ?)