Run AT command using PHP exec()

by emma   Last Updated July 12, 2019 11:02 AM - source

I have to schedule a few tasks to run only once in the near future. For that i'm intending to use the at command. I want to schedule those tasks using exec()(or any other recommended method).

But i'm stuck. Trough putty i can manually schedule tasks this way:

[email protected]:~# at 09:00am Jul 15 [enter]
at> php /path/to/script.php [ctrl+d]

But i can't figure out a way to do it trough php. Help:-s

Tags : php 19.04

Answers 1

You can use this in the command you use to execute:

echo "php /path/to/script.php" | at 09:00am Jul 15

I don't use PHP but it looks like it then needs to be

exec('echo "php /path/to/script.php" | at 09:00am Jul 15')
July 12, 2019 10:24 AM

Related Questions