Posted by: uttamkumar | May 28, 2008

Setting CronJob from web-browser.

In order to set a cronjob from a site/webpage using follow the following steps.

1. Write a script which will create/append a file with a cron task

2. call cron command of shell prompt using exce/system function from php and specify the filename from where task to be read.The file name will be the same file name where cron task has been written using script.Command will be as follows.

exec(“crontab UserName path/of/the/file”);

make sure that cron.allow file in the directory /etc has username specified for which cron has been set up.

you can check username for webbrowser using phpinfo() function of php.


Leave a response

Your response:

Categories