Report this

What is the reason for this report?

How to auto re-new letsencrypt certificate for a website every 3 months using cron?

Posted on March 26, 2019

I update it manually using this command

sudo systemctl stop nginx
url="my_domain123.com"
sudo certbot certonly --standalone -d $url -d www.$url --email main@$url
sudo systemctl start nginx

This works fine, but it’s manual. If I create a bash script with this code and a cron task which I’ll call once in [80…89] days, will it work as I expect? With no hidden issues?

Note: this works fine when doing it manually - by hands. I only want to automate it using cron, in a simple way, without overcomlecating it.

No third-party libraries and tools.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.