Skip to content

Instantly share code, notes, and snippets.

@askz
Last active January 12, 2017 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save askz/405d45f0b98376d481dbb55ae16f4c19 to your computer and use it in GitHub Desktop.
Save askz/405d45f0b98376d481dbb55ae16f4c19 to your computer and use it in GitHub Desktop.
Cron task for automatic renewing of +/- 30 days expiring certificates
# /etc/cron.d/letsencrypt: crontab entries for the letsencrypt package
#
# Upstream recommends attempting renewal twice a day
#
# Eventually, this will be an opportunity to validate certificates
# haven't been revoked, etc. Renewal will only occur if expiration
# is within 30 days.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 */12 * * * root test -x /usr/bin/letsencrypt -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && letsencrypt renew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment