找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 442|回复: 0

[N1盒子] cron出错

[复制链接]
以下一段代码,单独可执行,但添加到root的crontab中,问题出错,提示:cron.err crond[18689]: USER root pid 19071 cmd sh /usr/sbin/monitor.sh 2>&1

在/root/rcord中能看见'hello'和date值。
#!/bin/sh
source /etc/profile
PING=`/bin/ping -c 5 61.128.128.68|grep -v grep|grep '64 bytes' |wc -l`
if [ ${PING} -ne 0 ];then
    echo 'hello' >> /root/record
    date >> /root/record
    exit 0
else
    /etc/init.d/network restart
fi
sleep 10

PING2=`/bin/ping -c 5 61.128.128.68|grep -v grep|grep '64 bytes' |wc -l`
if [ ${PING2} -ne 0 ];then
    echo 'boy' >> /root/record
    exit 0
else
    reboot
fi


我的恩山、我的无线 The best wifi forum is right here.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-27 07:51

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表