linux crontab定时任务执行出错

evin_qiu 2016-02-17 06:10:59
如下执行这条命令出现这个错误 -bash: */1: No such file or directory而且a.sh这个脚本根本就没执行,如果我单独执行sh /root/changerpasswd/a.sh &是可以的,求解。
[root@qiu changerpasswd]# */1 * * * * sh /root/changerpasswd/a.sh &
[1] 25202
[root@qiu changerpasswd]# -bash: */1: No such file or directory
[root@qiubaolin changerpasswd]# crontab -l
no crontab for root
...全文
194 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
EvanAnder 2016-02-19
  • 打赏
  • 举报
回复
那个我弱弱的说一句,要执行的二进制解释器没有指定全路径 */1 * * * * /bin/sh /root/changerpasswd/a.sh
KEL-1 2016-02-18
  • 打赏
  • 举报
回复
没有把任务写入到定时任务中,使用命令crontab -e来进行添加定时任务
阿尔法Al 2016-02-18
  • 打赏
  • 举报
回复
终端输入crontab -e 将 */1 * * * * /root/changerpasswd/a.sh这行命令写入,在init.d里面重启cron服务即可。

19,615

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧