摘要: 添加crontab任务: crontab -e */1 * * * * sh /目录/xx.sh >> /目录/xx.log */1 * * * * sh /root/nb/iot-data.sh >> /root/nb/schedule/iotschedule.log 重启crontab服务: s 阅读全文
posted @ 2022-03-04 16:47 大日很忧伤 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 上一篇文档脚本手动能执行成功,crontab定时任务执行脚本不成功。 原因:cron的环境变量和shell脚本的环境变量不一样 解决办法: #方法一:定时任务里面切换到root执行() */5 * * * * su - root -c "/data/pkgs/mysql/tools/auto_bac 阅读全文
posted @ 2022-03-04 16:44 大日很忧伤 阅读(2333) 评论(0) 推荐(1) 编辑
摘要: 最近有个定时执行的脚本,校验服务是否在启动状态 写好脚本总是报错 #!/bin/sh # 在这修改程序名和程序所在目录,其他不用改 name="carte" path="/app/bigdata/data-integration/" pid=`ps -A |grep $name| awk '{pri 阅读全文
posted @ 2022-03-04 15:33 大日很忧伤 阅读(2565) 评论(0) 推荐(0) 编辑