Missing user-name at crontab line

I believe at https://certbot.eff.org/lets-encrypt/centosrhel7-apache the user-name (root) is missing:

0 0,12 * * * root python -c ‘import random; import time; time.sleep(random.random() * 3600)’ && certbot renew

1 Like

It’s a bit ambiguous, since a username is not valid when editing a user’s crontab (e.g. with crontab -e).

Perhaps the website could explicitly specify one way or the other.

I agree.
Thank you.
Hynek

If using sudo to edit the crontab, it would always execute as root...

So that might not be the issue

Thank you

I was not talking about a user-name used for editing crontab. I meant user-name the cron uses to start “certbot renew”. Did I get your point?

There are two different crontab formats.

One is the format used by crontab -e to edit the crontab for a particular user. This crontab is implicitly associated with the user that it was created by, so all its commands run as that user and it doesn’t need to specify a username in the crontab itself. If you run crontab -e, the commands run as you; if you use sudo crontab -e, they run as root.

The other format is used for the system-wide crontabs such as /etc/crontab and /etc/cron.d/* and this format does require a username to be specified.

Incidentally the documentation on the certbot website is maintained in git if you want to propose a change :slight_smile:

Yeah… Apologize for misunderstanding…

However, won’t all certbot commands require sudo rights? (Which literally means you must use root or pi to execute?)

Sure, but you could still choose whether to create the crontab record with crontab -e or cat >> /etc/crontab or something.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.