need some assistance or explanation. I try to have a complete automatic renewal process, but it seems that it is not working with cronjob.
For some test purpose I have defined the follwoing cronjob, to see if the job will be executed every 15 minutes. But I just can see the manual runs in the logs.
If I run the command certbot renew --standalone --pre-hook "service nginx stop" --post-hook "service nginx start" >> /var/log/letsencrypt/letsencrypt.log manually it works and I can see new created logfiles, but not the ones that should be created by crontab:
sorry for the late response. I did it several ways. First I copied/pasted it from this website. Then I typed it manually. Usually I use sudo crontab -e or as root user crontab -e.
Not sure if I answered your question right.
But I found a workaround. Based on your replies here I have disabled certbot.timer and added the following line to my crontab:
As @Sm3rT already recommended, you should use the full path to the executable. Regarding the reason you are not seeing the log file created, keep in mind that by default, cron will use sh shell to execute your command instead of bash so things like redirection could not work as you expect, try the following syntax (just added the full path to certbot and 2>&1 at the end of command).