Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #3444
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Queuing at job from within php program? |
| Date | 2011-10-17 11:20 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <j7hh49$dko$1@dont-email.me> (permalink) |
| References | <j7haab$mh2$1@dont-email.me> |
On 10/17/2011 9:24 AM, bobm3@worthless.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).
>
> Here is a sample code snippet:
>
> $cmd = "echo \"podcast -c $filename\" | at $hr:$mn $_ampm";
> passthru("$cmd", $Retcode);
> echo "$Retcode";
>
> returns 1
>
> Then I thought that perhaps the 'at' was not reading stdin in this case
> so I tried a temporary file approach:
>
> $cmd = "echo \"podcast -c $filename\"";
> file_put_contents($filename.tmp, $cmd);
> passthru("at $_hr:$_mn $_ampm< $filename.tmp", $_RetVal);
> echo "$_RetVal";
>
> This time it returned 2
>
> I've got to be misunderstanding this function. So, I thought if any of
> you skilled readers have had luck with doing something like this you may
> be willing to share. However, any other suggestions greatly appreciated.
>
> Thanks
What is actually in $cmd when you execute the passthru command?
What happens when you type this exact output at a command line prompt?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Queuing at job from within php program? bobm3@worthless.info - 2011-10-17 13:24 +0000
Re: Queuing at job from within php program? Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-17 11:20 -0400
Re: Queuing at job from within php program? bobm3@worthless.info - 2011-10-17 15:51 +0000
Re: Queuing at job from within php program? Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-17 12:47 -0400
Re: Queuing at job from within php program? Robert Heller <heller@deepsoft.com> - 2011-10-17 13:27 -0500
Re: Queuing at job from within php program? Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-17 16:53 -0400
Re: Queuing at job from within php program? "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-10-18 09:51 +0200
Re: Queuing at job from within php program? Denis McMahon <denismfmcmahon@gmail.com> - 2011-10-18 03:43 +0000
Re: Queuing at job from within php program? Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-10-18 10:12 +0200
Re: Queuing at job from within php program? bobm3@worthless.info - 2011-10-19 21:40 -0400
Re: Queuing at job from within php program? SOLVED! bobm3@worthless.info - 2011-10-20 21:21 -0400
csiph-web