The current instructions for adding certbot renewal to /etc/crontab on macOS don't seem to work.
At least they don't seem to work on macOS High Sierra.
I had to modify the entry in crontab to have the complete path to certbot in order to get it to run.
I only discovered this after my certs expired because automatically renewing them via cron didn't work.
I think it might be better to modify the instructions to have users run "sudo crontab -e" and then paste the line into root's crontab entries rather than placing the entry in /etc/crontab. (Also, you have to remove "root" from the line when putting it inside root's crontab.)
[correct me if I'm wrong]
But doesn't it do more than just add that one line?
If I read that correctly, the first part lists the current users cron entries.
The second part appends the line in question.
The third part inserts the output of the previous two as replacement entries into the root user's cron.
OR does that last part go into the current user's cron?
If third part writes to root user cron, then it seems to overwrite what was there.
If third part writes to current user, then it might not execute with proper credentials.
Only if the current user is root, does then this make sense (to me).
I tested this on my system before suggesting it here. The first part read from root's crontab and third part wrote to root's crontab on my macOS High Sierra computer. So, as far as adding that line to root's crontab (when run from a non-root account), it produced the desired result for me in my testing.
However, when I checked the Let's Encrypt logs this morning, certbot did not appear to have run some time after midnight last night. So, I'm doing some more testing to see why that is.
Basically, I've modified the entry in root's crontab to look like this:
So, that I can both see if the scheduled job is running as intended and to see what error is produced by trying to run certbot without a full path from root's crontab. (I had to add the full path to certbot in order to get it to run from /etc/crontab.)