当前位置: 技术问答>linux和unix
crontab不起作用?
来源: 互联网 发布时间:2016-01-08
本文导语: 正在学习unix shell $ ps -ef | grep cron root 223 1 0 1ÔÂ 16 ? 0:00 /usr/sbin/cron ****** 14721 14439 0 11:16:56 pts/18 0:00 grep cron $ crontab -l # (put your own initials here) echo the d...
正在学习unix shell
$ ps -ef | grep cron
root 223 1 0 1ÔÂ 16 ? 0:00 /usr/sbin/cron
****** 14721 14439 0 11:16:56 pts/18 0:00 grep cron
$ crontab -l
# (put your own initials here) echo the date to the console every
# 15 minutes between 6pm and 6am
0,10,15,20,25,30,35,40,45,50,55 18-06 * * * /bin/echo `date` > /tmp/anycron
$ ls -al /tmp/anycron
/tmp/anycron: 无此文件或目录
从第一条命令看cron已经启动?
第二条命令看,每隔5分钟,往/tmp/anycron里写时间
第三条命令看,半天也没见/tmp/anycron存在?
为什么?
$ ps -ef | grep cron
root 223 1 0 1ÔÂ 16 ? 0:00 /usr/sbin/cron
****** 14721 14439 0 11:16:56 pts/18 0:00 grep cron
$ crontab -l
# (put your own initials here) echo the date to the console every
# 15 minutes between 6pm and 6am
0,10,15,20,25,30,35,40,45,50,55 18-06 * * * /bin/echo `date` > /tmp/anycron
$ ls -al /tmp/anycron
/tmp/anycron: 无此文件或目录
从第一条命令看cron已经启动?
第二条命令看,每隔5分钟,往/tmp/anycron里写时间
第三条命令看,半天也没见/tmp/anycron存在?
为什么?
|
先kill掉,再到/etc/init.d下重新启动试试!