My crontab is set up, so that letsencrypt renew gets executed bi-daily, and does its job.
The only thing not automated is reloading nginx. I could simply add yet another crontab entry for it but I rather wouldn’t. Every server restart is a potential opportunity for things to go wrong, so I’d like to reload nginx only when at least one cert gets renewed.
--post-hook "service nginx restart" is probably what you’re looking for.
--post-hook POST_HOOK
Command to be run in a shell after attempting to
obtain/renew certificates. Can be used to deploy
renewed certificates, or to restart any servers that
were stopped by --pre-hook. This is only run if an
attempt was made to obtain/renew a certificate.
(default: None)