problem of task of crontab in docker of ubuntu do not working!
由於各種原因,要在Ubuntu docker上部署crontab任務,如
- Let's Encrypt it的證書自動續期;
- ddns的心跳;
- 監控任務;
- 。。。
今天意外的發現,ddns失效了,沒能及時的更新ip,WTF!!
手動debug一遍程序,沒有發現問題。立馬懷疑上crontab,加上一個打日志的crontab,10分鍾后竟然沒有動靜~~系統日志里完全找不到痕跡~~百度也沒啥結果~~怎么辦?
Google發現一堆沒用的說辭,這里直接放 人肉驗證過的答案吧。
其關鍵點在於:You can run cron without daemon mode.
root@xxxxxx:~# cron -f