home · contact · privacy
Improve certificate renewal mechanism.
[config] / all_new_2018 / linkable_etc_files / web / etc / cron.d / certbot
1 # /etc/cron.d/certbot: crontab entries for the certbot package
2 #
3 # Upstream recommends attempting renewal twice a day
4 #
5 # Eventually, this will be an opportunity to validate certificates
6 # haven't been revoked, etc.  Renewal will only occur if expiration
7 # is within 30 days.
8 SHELL=/bin/sh
9 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
10
11 # plomlompom added the --webroot -w /var/www/html/ so that renewal
12 # works with nginx running, and the nginx reload post-hook so that
13 # the new certificates are linked to by nginx. Note that by default
14 # we rely on the systemd timer service file instead of this cronjob,
15 # but since both are installed by the certbot package to serve which
16 # ever of the two is used, we cautiously adapt both of them too.
17 0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew --webroot -w /var/www/html/ --post-hook "service nginx reload"