网站更新内容:请访问: https://bigdata.ministep.cn/

crontab lsof: command not found

问题原因是 crontab 调度使用的路径 和 r普通账户使用的路径不一样

使用绝对路劲即可

# pid_cnts=$(lsof -i :9222 | grep -v grep | awk '{print $2}' | wc -l)
pid_cnts=$(/usr/sbin/lsof -i :9222 | grep -v grep | awk '{print $2}' | wc -l)

参考:
macos-从cronjob运行mac osx命令-代码日志]

posted @ 2021-05-17 11:16  ministep88  阅读(262)  评论(0编辑  收藏  举报
网站更新内容:请访问:https://bigdata.ministep.cn/