Hello Piti and thanks a lot for your recommendation.
Unfortunately, it seems that "cron jobs" and "at deamon" are designed for frequently scheduled tasks.
In my case, I just want to apply a delay upon the delivery time of an email sent by PHP. And the delay has to be different each time an email is sent.
For example, each time an email is sent after a form submission, an email would be sent with a delay randomly chosen between 5min and 6 hours.
If I use cron jobs, I will have to set up a cron job each time I'm willing to send an email and delete it after the mail is sent.
i said use at, not cron
at executes command at specific time and that's it, cron is a kind of repeating scheduler
if you issue
a) echo "mkdir /home/mails" | at now +3min
in 3 minutes there will be a directory mails created in the /home dir
b) at now +5hours -f command.txt
in 5 hours all commands from the file command.txt will be executed
after execution the command is deleted from the queue
so just create a php script, lets say mailnow.php, and in your submit script use:
exec('echo "/usr/bin/lynx -dump
Hello Piti.
Thanks a lot. It's a pity I can't give you more than one star
Anyway, thanks to you I've understood the purpose of AT deamon, but unfortunately I can't find any relevant information about how to install and use it on FreeBSD.
I'll search again but I'm affraid I'll have to stick to Cron.
at is part and parcel with ost cron installs, type
man at
for more info, or to list at job queues :
at -l (should work)
if you get anything that says at is not installed I will be suprised ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
Thank you Karver.
The funny thing is that even the technical support staff of the company that hosts us didn't know at was installed on the server.
Have a nice day.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.