Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

为什么 我写的crontab 命令没有执行啊?

我在 这个文件里
vim /etc/crontab
编写了这天命令
图片描述

然后在
vim /var/www/test/log.php
图片描述

但是在 /var/www/test/ 没有 run.txt这个文件 说明 crontab根本没有执行

要执行crontab 需要把命令写在哪个文件啊,是不是不能写在 vim /etc/crontab 这里啊。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

不是 编辑这个文件是没有用的 还要加载这个文件

两种方法

1. 要执行这个来编辑 编辑完成之后会自动加载

    crontab -e

2. 或者随便写到一个文件里 然后运行

    crontab file-name.txt

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.7k users

...