Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

scheduling with 'AT' from php

Question posted by: bandito40 (Newbie) on March 28th, 2008 06:28 PM
Hi,

I am wondering if it is possible to give the escape command ctrl+d via the php function exec() or some function that is similar. I am trying get php to call the 'AT' command which asks for the ctrl+sequence to close the entering of a new scheduled event. I tried adding '<EOT>\n' at the end of the command sequence but that still didn't work. I only want the event to run once unlike CRON that's why I am using 'AT' instead. But I can't get it to execute from PHP and I figure it's because I don't know how to give the ctrl+d sequence programmically via php's exec() function. I also tried system(), passthru(), shell_exec() and many other functions that do basically the same thing but no luck. Anyone have any ideas???

For example:
Code: ( text )
  1. $time  = date('H:i', strtotime('+30 minute')) ;
  2. exec ("at $time\nmkdir test\n<EOT>\n");


Also tried:
Code: ( text )
  1. $time  = date('H:i', strtotime('+30 minute')) ;
  2. exec ("at $time|mkdir test|<EOT>|");

Neither worked.

Thanks,
Carl
www.gaihosa.com


Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
dlite922's Avatar
dlite922
Needs Regular Fix
406 Posts
May 13th, 2008
04:37 AM
#2

Re: scheduling with 'AT' from php
try shell_exec();

And don't execute "something" that only executes "something else".

(sorry but that makes sense to me right now lol)

How about execute what the Tast Scheduler is suppose to execute if you're just executing this even only one time. (Scheduler = for scheduled events to occure automatically...without php)

Good luck,


Dan

Reply
Reply
Not the answer you were looking for? Post your question . . .
170,099 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top PHP Forum Contributors