crontab -e 异常

wang_qiao_ying 2014-02-19 06:34:39
大家好,我的一个脚本用crontab定时运行,我做了如下操作:
1. crontab -e
2. 添加内容 1 * * * * /home/my_path/getIp.sh (每小时的第一分钟执行)
3. wq 保存

头几个小时挺稳定的,后来就不执行了,我用crontab -e 看了一下,里面多了几千行很多东西,而且我添加的任务也被冲掉了,crontab -e 显示如下:
s file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# Edit this file to introduce tasks to be run by cron.
# Edit this file to introduce tasks to be run by cron.
# Edit this file to introduce tasks to be run by cron.
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
。。。。。。
后面还有几千行

请问这是怎么回事啊,我的操作方法不对吗,请帮忙指教一下,谢谢大家了!
...全文
319 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wang_qiao_ying 2014-03-20
  • 打赏
  • 举报
回复
服务器中毒了,被病毒程序修改的,奶奶的!
li735937915 2014-02-20
  • 打赏
  • 举报
回复
1.crontab -e 修改为: 01 * * * * /home/my_path/getIp.sh 2.保存定时任务后,执行如下命令,重启定时任务: service cron restart
上海小胖 2014-02-20
  • 打赏
  • 举报
回复
试试看这样 crontab -e 01 * * * * sh /home/my_path/getIp.sh
wang_qiao_ying 2014-02-20
  • 打赏
  • 举报
回复
我去,怎么一个回复都没有啊,这论坛是怎么了。

19,613

社区成员

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

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