![見出し画像](https://assets.st-note.com/production/uploads/images/141974600/rectangle_large_type_2_d5fe2b453e649ae791c02dc237eb19ee.png?width=1200)
Photo by
momoro66
Let's Encrypt自動更新
こんにちは、アイシティーリンクの由木です。
今回はLet's Encrypt自動更新を書いていこうと思います。
証明書の更新にはroot権限が必要となります
#crontab -u root -e
・cron設定
一番下の行に下記追加
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 */12 * * * root test -x /usr/bin/certbot -a ! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew
![](https://assets.st-note.com/img/1716767476555-KOszBqsJBm.png?width=1200)
・確認
#systemctl list-timers | grep certbot.timer