Missing user-name at crontab line


#1

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


#2

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.


#3

I agree.
Thank you.
Hynek


#4

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

So that might not be the issue

Thank you


#5

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?


#6

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:


#7

Yeah… Apologize for misunderstanding…

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


#8

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


#9

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