前提・実現したいこと
https://qiita.com/meguroman/items/517f22f68b9235163036
http://www.meguroman.com/cron_multiple_run_protection/
上記のページを参考にしたのですがログを見ているとまだ同時起動してしまっています。
何が違うのか教えていただきたいです。
試したこと 該当のソースコード
pwd
/opt/scripts/sample/text.sh
root/ ├ opt/ │ └ scripts/ │ └ text.sh ├ var/ │ └ log/ │ └ crontest.log
text.sh
#!/bin/sh LOGFILE=/var/log/crontest.log echo "-- pid:$$ start -- " >> ${LOGFILE} sleep 70 echo "-- pid:$$ end --" >> ${LOGFILE}
crontest.log
-- pid:12798 start -- -- pid:12740 end -- -- pid:12857 start -- -- pid:12798 end -- -- pid:12911 start -- -- pid:12857 end -- -- pid:12969 start -- -- pid:12911 end -- -- pid:13518 start -- -- pid:12969 end --
(crontab -l)
* * * * * pidof -x text.sh >/dev/null || /opt/scripts/sample/text.sh >> /var/log/myjob.log
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/24 07:45
2020/03/24 07:45
2020/03/24 07:48
2020/03/24 07:53