I just created my first cron job for renewing certs using certbot-auto. The advice and examples for this online are all over the map, but I found what I think is the recommended solution–running certbot-auto renew twice a day at random times withing designated hours. Would some gurus be willing to just look over my code here and tell me if this is correct? Much appreciated. This is on Amazon Linux EC2 with Apache 2.4. Certbot-auto is installed in the ec2-user home directory.
0 3,15 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo ./home/ec2-user/certbot-auto renew –debug
I do not have to restart Apache separately, correct? Doesn’t certbot-auto do that when it renews the cert?
Thanks for the tips.