crontab 执行没反应_crontab 不执行问题,网上找了一个小时都没找到解决方法,醉了...

先说我的系统,是 Ubuntu 16.04

然后我要运行一个定时任务,所以为了测量定时任务是否执行,先运行一个最基本的测试,但是发现根本没运行。

我的做法:

使用 crontab -e 进行编辑模式,然后写入代码如下:

1 * * * * echo 111 >> /home/alex/Desktop/mycodes/k.txt

查看定时任务 crontab -l 可以看到跟我编辑的一模一样的结果

然后我重启 cron 服务,使用如下命令:

service cron restart

但是我发现这个定时任务并没有启动啊

而且我还发现,网上都是说 crond,但是我把 cron 改成 crond 就报错,根本没有这个服务,请问我哪里没有作对?

贴一下 /var/log/cron.log 的日志:

Apr 21 17:04:01 VirtualBox crontab[6460]: (alex) BEGIN EDIT (alex)

Apr 21 17:05:18 VirtualBox crontab[6460]: (alex) END EDIT (alex)

Apr 21 17:05:23 VirtualBox crontab[6473]: (alex) LIST (alex)

Apr 21 17:07:04 VirtualBox cron[6489]: (CRON) INFO (pidfile fd = 3)

Apr 21 17:07:04 VirtualBox cron[6489]: (CRON) INFO (Skipping @reboot jobs -- not system startup)

Apr 21 17:08:41 VirtualBox cron[6510]: (CRON) INFO (pidfile fd = 3)

Apr 21 17:08:41 VirtualBox cron[6510]: (CRON) INFO (Skipping @reboot jobs -- not system startup)

Apr 21 17:10:07 VirtualBox crontab[6526]: (alex) LIST (alex)

Apr 21 17:10:44 VirtualBox crontab[6534]: (alex) BEGIN EDIT (alex)

Apr 21 17:11:01 VirtualBox crontab[6534]: (alex) END EDIT (alex)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值