certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"
Validate if the following file actually exists:
/usr/bin/certbot
Create or update File: /etc/systemd/system/certbot-renewal.service
[Unit]
Description=Certbot Renewal
[Service]
ExecStart=/usr/bin/certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"
Create or update File: /etc/systemd/system/certbot-renewal.timer
[Unit]
Description=Timer for Certbot Renewal
[Timer]
OnBootSec=300
OnUnitActiveSec=1w
[Install]
WantedBy=multi-user.target
sudo systemctl start certbot-renewal.timer
sudo systemctl enable certbot-renewal.timer
systemctl status certbot-renewal.timer
journalctl -u certbot-renewal.service