Problem: Want to auto-renew SSL cert via letsencrypt. I use letsencrypt-auto --apache -d domain.name to create SSL certificate.
Solution: first make letsencrypt program executable from anywhere since most of you just download a zip file from the Internet.
ln -s /opt/letsencrypt/letsencrypt-auto /usr/bin/letsencrypt
then you can enter letsencrypt to trigger /opt/letsencrypt/letsencrypt-auto.
above command can eventually renew all certificates that about to expired.
Then add a record to cron job:
enter command crontab -e and add below content
0 0 * * 1 /usr/bin/letsencrypt renew >> /var/log/le-renew.log
the command will trigger at 00:00 on every Monday. The renew record will save on /var/log/le-renew.log
9/4/2020: below is the create SSL command, just a note for me:
cd /opt/letsencrypt/ ./letsencrypt-auto --apache -d www.domain.com