问题描述
我有一个Linux服务器,在这里我想执行一个cron作业发送生日邮件给我的所有朋友一个PHP程序。我想创建一个从数据库读取数据并发送邮件的PHP程序。
I have a Linux server and in this I want to execute a cron job for sending birthday mail to all my friend with a PHP program. I want to create a php program that read data from database and send the mail.
我想知道cron job的命令,每天自动执行程序。我不知道Linux命令。
I want to know the command of cron job to execute the program on every day automatically. I have no knowledge of Linux commands.
推荐答案
你会想读一下crontab命令,您将这样做。
You will want to read up a little bit on the 'crontab' command but basically you will do this.
从linux命令提示符运行crontab命令。
From a linux command prompt run the crontab command.
* * * * * php yourscript/path
您可以通过修改*值来设置什么时间。有关信息,请参阅此网址:
You can set what time by modifying the * values. See this URL for information on that:
这篇关于Cron作业执行PHP程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!