1. Create the file in /etc/cron.weekly/certbot-renewal using the following command
    sudo vi /etc/cron.weekly/certbot-renewal
  2. Place in the following in the file and save it:
    #!/bin/sh
    
    /usr/sbin/certbot-auto renew --no-bootstrap --no-self-upgrade --post-hook "service nginx restart"
  3. Change the mode of file to 755 using the following command:
    sudo chmod 755 /etc/cron.weekly/certbot-renewal