Click to See Complete Forum and Search --> : using the 'at' command


mat
10-10-2001, 07:08 AM
Hi,

I'm relatively new to Linux, and I have to say that I am both impressed and a bit scared by the whole thing : )

I wonder if anyone could spare a small amount of time to give me some advice - I am trying to write a web app that uses smssend to send SMS messages to your choice of user, with a time delay if you require (as a reminder service). I have the message send interface working - I use exec($foo) in a php script where $foo is the smssend command and args. The problem I am having is passing this command to 'at'.

Does 'at' only run shell scripts, or can I pass it a command and several arguments? I could get php to write the smssend string to a file, and then delete that file later, but it would be preferable to just do one thing, rather than doing some kind of 'delete this file once it's run' scripting stuff. This is partly because I know nothing about PERL and partly for the sake of elegance : )

For the record, the smssend command looks like this:

smssend $provider $username $password $number $subject "$message"

The web user has the required permissions to run at, and the system is Debian 2.4.7 on a Pentium Pro 180 server, ADSL internet connection. Web server is Apache, obviously : ) and is running php4.

Any help or advice would be greatly appreciated.

tia,


mat. :cool:

Craig McPherson
10-10-2001, 07:37 AM
First, make sure atd is running. Then have the exec command go something like this:

exec(echo 'smssend $provider ... "$message"' | at $time)

I'm pretty sure that'll work for you.

mat
10-10-2001, 10:46 AM
Thanks, but that doesn't seem to work - it sends me an email saying that it did, but it doesn't send the message.

Well - it looks like the problem is with smssend then.... : (

Thanks anyway...