Linux定时任务

WBOY
Release: 2016-06-06 20:11:21
Original
1150 people have browsed it

我想每周一凌晨两点执行一个PHP文件(程序会导出一个excel),然后将这个文件自动通过邮件发送

回复内容:

我想每周一凌晨两点执行一个PHP文件(程序会导出一个excel),然后将这个文件自动通过邮件发送

可以用crontab设置定时任务,用mutt命令发送带附件的邮件。

liunx下的 crontab 服务
它支持的格式如下:
分 时 天 月 周

因此按你的需求可用下面的方式

<code>0 2 * * 1  php  index.php</code>
Copy after login

Linux定时任务

可以用这个网站给的工具测试写的定时规则是否符合要求
网址:http://tool.lu/crontab

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!