[sh]top添加到crontab不生效問題解決

今天遇到個小問題 top結果賦值給變量,放到文件作處理, 可是不生效問題.
https://www.phpbulo.com/archives/509.htmlphp

cat top.sh
NAME="/root/ma/top_"$(date +%Y-%m-%d)
res=$(/usr/bin/top -b -n 1|head -1)
echo $res >> $NAME.txt
crontab -l
* * * * * sh /root/top.sh

相關文章
相關標籤/搜索