LoginSignup
0
0

More than 3 years have passed since last update.

SSL証明書( Let’s Encrypt )の更新をcronで自動化するための、crontab内の記述

Posted at

https://hi3103.net/notes/web/1082
を参考に、
0 3 * * * root /usr/bin/certbot renew
のように、SSLを自動的に更新する記述を、「crontab」に、行いたいです。

Macのコンソールを開いて、
「crontab」を編集して、

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR
sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
00 04 01 * * root /usr/local/bin/certbot-auto renew --post-hook "sudo service httpd restart"

のように、最後の行に、
毎月の1日、04時00分に実行
するような記述をして、保存して終了するところまで設定しました。

変更したのは、太字の最終行だけを追加した形です。

crontab内の記述を、最終行に上記の1行だけを追加して、保存した形なのですが、
SSL証明書( Let’s Encrypt )の更新をcronで自動化するための記述として、合っているか?
について、アドバイスを頂くことが出来ますと有り難いです。

お詳しい方がいましたら、是非、ご助言を頂くことが出来ますと幸いです。
(特に、certbot-auto renew --post-hook "sudo service httpd restart"の
部分が、
certbot renew
のみしかかかれていない設定方法がブログなどに書かれている場合も有り、
SSL証明書( Let’s Encrypt )の更新として、合っているか?について
お詳しい方が、いましたら、どうぞよろしくお願いします。)

どうぞよろしくお願いします。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0