Home > Backend Development > PHP Tutorial > Linux定时任务

Linux定时任务

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:11:21
Original
1256 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:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template