I created a renew-certificate.sh in /opt/letsencrypt/scripts:
And plan to run this script every 1st day of the month with crontab:
My certificate was delivered the 23rd of April 2020 until the 22nd of July 2020.
Nevertheless, we are the 4th of May and I supposed my script didn’t work because the issue date of my certificate didn’t change (still the 23rd of April).
What I understand is my script should run every first day of the month and the issue date of my certificate should change every month. Am I right ?
My script run but the renewal didn’t work ? (My script backupDB.sh works well by the way)
If you configured your script exactly like the steps on Bitnami, you forgot step 3 completely.
Since you didn’t provide any information regard your domain, I don’t know. (I guess @JuergenAuer won’t know either).
You shouldn’t expect to issue one certificate per a short period of days without any reason, it’s not only excessive waste of resources, but also useless and might be considered abusive. (Remember, even if Let’s Encrypt won’t charge you for that certificate, it still costs Let’s Encrypt to issue one).
Under normal circumstances, you should consider issue one certificate every 60-90 days.
Also, I believe Lego (the client Bitnami used) have the ability to renew certificate, so please don’t bother create new certificates rapidly. You might also hit rate limit pretty quickly.
Your script definitely runs, but I don’t know what should happen after that, as you didn’t provide enough information.
P.S. I’m not a Let’s Encrypt employee, so above opinions are personal.
I understand it’s useless to renew a certificate for a short time, I agree with you.
I have already issue a certificate, I don’t want to issue a new, I want to renew it. How can I configure crontab to renew it every 60 days ?
If you followed step 5 on that document and did all things correctly, that script should be executable. However, Lego (the client you used) won't force renew that certificate every day. Instead, it will check the certificate every day when you execute that script, and renew only when it's close to expiry (generally 30 days left).
okay thank you @stevenzhu, I didn’t know lego doesn’t renew a certificate if the expiration date is more than 30 days left.
So I guess I have to wait until 1st of July to know it’s working or not