I did want to show a method to do this, but you'd need to copy /var/spool/cron before doing so (in case anything didn't properly process):
Code:
cp -R /var/spool/cron /var/spool/cron.bak110510
for i in `ls /var/cpanel/users/`;do echo "0 3 * * * /home/$i/public_html/cron.php" >> /var/spool/cron/$i;done
When you run the above command, replace the
0 3 * * * with the actual interval for the cron, since this is 3:00am server time every day for my example. Replace
/home/$i/public_html/cron.php with the path to the file (please note it is public_html that is the true path rather than www as www is a symlink only to public_html). The $i portion should not be changed in that path as it represents the username that is pulled from /var/cpanel/users/ list in the
for i in `ls /var/cpanel/users` section of the command.
Please note that the best benefit of doing it this way, if the crontab files did not already exist for the user, this command creates those files for every user found in /var/cpanel/users location. Please ensure that root does not have an existing file in /var/cpanel/users/ location, since it will then add contents to the root crontab.