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.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.