treffynnon/PHP-at-Job-Queue-Wrapper

Allow logging to a file

Closed this issue · 6 comments

Example :
echo 'php /my_app/test.php > /var/log/my_app/test.log 2>&1' | at now +10min

I don't think there's anything stopping you from doing that already. You
should just be able to add the redirection to your command in addCmd from
memory.
On 30 Mar 2016 1:48 a.m., "jeff1326" notifications@github.com wrote:

Example :
echo 'php /my_app/test.php > /var/log/my_app/test.log 2>&1' | at now +10min


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#3

No since the command is escaped.

If i do at -c 5
I get php /my_app/test.php \> /var/log/my_app/test.log 2\>\&1

Yep, of course. I will think about this. I have been on and off working on a version two of this wrapper so that's probably the place I would implement it.

I've not used this library myself for a good number of years now. I was part way through a version 2 about four years or so ago that would have attempted to support logging.

Sorry to say though that the code I was working on will never be released as I've far too many other projects on my plate. I don't have time to write a new major version of a library that I don't use and will probably never have cause to use again.

Please fork the code or submit pull requests if the current state of the library does not match up to your requirements.

I think I will fix this on v2 branch.

It should be fixed now :). Please use following code snippets:

$job = 'echo \"12345\" > /tmp/echo.log 2>&1';
$at = new At();
$at = $at->setEscape(false);
$at::cmd($job, 'now + 2min', 'c');

When using the at -c job_number, it will get following result:

echo "12345" > /tmp/echo.log 2>&1