Hi all:
I have an expect script that I need to run from crontab. I have a browser based frontend for this script that I created using PHP. One of the many functions that this frontend does is I can set a cron job for my script. So, I put in the times I want the script to run and when I submit the form, php edits a "schedule.cron" file and then I use exec('crontab schedule.cron'); to add it to cron. This crontab does not run perhaps because it is set under user www-data and it does not have the proper permissions. After searching the web, decided to wrap my expect script in a c program, setuid the c binary to run as root. I also edited the sudoers file so that I can run exec('sudo crontab schedule.cron') from php. The end result is this:
I create a cron job under root to run my c binary.
When the c binary runs, it runs as root.
Still my script is not running when I set it from the web frontend. Whenever I do it from the command line, it runs just fine. Can anybody help me?
My problem is basically that I need to set a cronjob using a browser, I set this cronjob and I check to see that it is indeed set, but the job never runs when I do it from the browser.