Tuesday, May 13, 2008

To Add the crontab entry in the linux using php script

Below is the sample code which makes your task easy to add the crontab entry using the php script

test.php

> /var/spool/cron/root"); //add the entry in crontab

echo shell_exec( "/etc/init.d/crond restart"); //restart the service to make change in effect

?>

No comments: