Hey all,
I am trying with little success to use PHP to schedule a command to be executed on the system at a certain time. Basically, this is what I want:
The user fills in information for an email job to be processed via a web interface. Because of the time it takes to generate the emails with information from database I wanted this to happen in the background instead of tying the users web browser up. I work a php shell script that generates the emails and it works great. But when I try to use 'at' to schedule it from within php, it processes the script and sends the email and doesnt schedule the job. Code segment:
echo("System Time: $now<br>");
echo("Job Scheduled for: $at<br>");
system("./phpscript | at now + 1 minutes");
Any ideas how I can set this up to be submissible via the web, then just run the job in the background at whatever time?
I have tried exec, passthru and system and each one of them does the same thing, it executes the script before it attempts to schedule the job, thus sending out the emails before I want them to go.
Thanks!
Joe