FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Queuing at job from within php program?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Queuing at job from within php program? [message #175678 is a reply to message #175666] Tue, 18 October 2011 08:12 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 10/17/2011 3:24 PM, bobm3(at)worthless(dot)info wrote:
> Fellow php'ers;
>
> I'm having some difficulty getting this to work: Based on a date/time
> selected by a user on a web form I would like to use the "at" command to
> schedule that task.
>
> I've tried various php functions (system, exec, passthru) with the same
> results (return code 1 - which I cannot seem to get the error message
> from).
>

<snip>

Others commented on the issues that can arrise with rights.
(More specific: the PHP-user (www-data or apache) adding tasks.)

I want to add another approach that I prefer.
(Written for Unix-lie systems. Replace cronjob with task-scheduler for
Windows.)

Personally I don't like my software to schedule new tasks automatically.
So if I need scheduling, I prefer to create 1 cronjob by hand, for
www-data, that runs a script (can be PHP).
That script than pulls from a database certain tasks WHEN they are needed.
Depending on the time-resolution you need you can run this cron-job once
a day, once an hour, every minute, etc.

I like it that way because I can catch the result, log the last time it
ran, etc. And e-mail myself or some admin in case of failure.

Just a thought. Maybe it helps in your situation.
If not, consider this noise. ;-)

Regards,
Erwin Moller


--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: declaring private variable in class
Next Topic: simple session question
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 09 17:09:40 GMT 2024

Total time taken to generate the page: 0.05691 seconds