Command '--cron' meaning #382

Closed
opened 2025-12-29 01:24:11 +01:00 by adam · 7 comments
Owner

Originally created by @nlevchuk on GitHub (Oct 9, 2018).

Hello. First of all thanks a lot for you script. It's really helpful.

I confused with meaning '--cron' command. At first glance i thought if i call the script with '--cron' command it should create crontab task. But it didn't do that.

Can you explain meaning of '--cron' key ?

Originally created by @nlevchuk on GitHub (Oct 9, 2018). Hello. First of all thanks a lot for you script. It's really helpful. I confused with meaning '--cron' command. At first glance i thought if i call the script with '--cron' command it should create crontab task. But it didn't do that. Can you explain meaning of '--cron' key ?
adam closed this issue 2025-12-29 01:24:11 +01:00
Author
Owner

@jobe1986 commented on GitHub (Oct 9, 2018):

The purpose of the --cron flag is to be passed as a flag when running dehydrated from crontab. For example in a crontab you would put something like:
7 10,22 * * * /home/jobe1986/dehydrated/dehydrated --cron >/dev/null 2>&1

Or if you wish to receive the output of dehydrated as an email then you could use:

MAILTO="jobe1986@example.com"
7 10,22 * * * /home/jobe1986/dehydrated/dehydrated --cron
@jobe1986 commented on GitHub (Oct 9, 2018): The purpose of the --cron flag is to be passed as a flag when running dehydrated from crontab. For example in a crontab you would put something like: `7 10,22 * * * /home/jobe1986/dehydrated/dehydrated --cron >/dev/null 2>&1` Or if you wish to receive the output of dehydrated as an email then you could use: ``` MAILTO="jobe1986@example.com" 7 10,22 * * * /home/jobe1986/dehydrated/dehydrated --cron ```
Author
Owner

@nlevchuk commented on GitHub (Oct 9, 2018):

But it's not understandable. And it's problem. Not for script execution, but for UI.

  • What does this /home/jobe1986/dehydrated/dehydrated --cron command do?
  • It checks if certificate has expired. If so, it will update him. Otherwise, nothing.

That's all! There is no action with cron.

There is more understandable name for that. For example, --update-certs.

The --cron key should only add the script to crontab and nothing more.

If need to check and update right now plus add to crontab it should look something like this:

/home/jobe1986/dehydrated/dehydrated --update-certs --cron

What do you think?

@nlevchuk commented on GitHub (Oct 9, 2018): But it's not understandable. And it's problem. Not for script execution, but for UI. - What does this `/home/jobe1986/dehydrated/dehydrated --cron` command do? - It checks if certificate has expired. If so, it will update him. Otherwise, nothing. That's all! There is no action with cron. There is more understandable name for that. For example, --update-certs. The `--cron` key should only add the script to crontab and nothing more. If need to check and update right now plus add to crontab it should look something like this: ``` /home/jobe1986/dehydrated/dehydrated --update-certs --cron ``` What do you think?
Author
Owner

@bllfr0g commented on GitHub (Oct 9, 2018):

It’s called --cron because it’s the flag you use when calling dehydrated from a crontab.

I agree it’s not the naming I would have chosen, but that’s what it is.

On Oct 9, 2018, at 07:04, Nikita Levchuk notifications@github.com wrote:

But it's not understandable. And it's problem. Not for script execution, but for UI.

What does this /home/jobe1986/dehydrated/dehydrated --cron command do?
It checks if certificate has expired. If so, it will update him. Otherwise, nothing.
That's all! There is no action with cron.

There is more understandable name for that. For example, --update-certs.

The --cron key should only add the script to crontab and nothing more.

If need to check and update right now plus add to crontab it should look something like this:

/home/jobe1986/dehydrated/dehydrated --update-certs --cron
What do you think?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@bllfr0g commented on GitHub (Oct 9, 2018): It’s called --cron because it’s the flag you use when calling dehydrated from a crontab. I agree it’s not the naming I would have chosen, but that’s what it is. > On Oct 9, 2018, at 07:04, Nikita Levchuk <notifications@github.com> wrote: > > But it's not understandable. And it's problem. Not for script execution, but for UI. > > What does this /home/jobe1986/dehydrated/dehydrated --cron command do? > It checks if certificate has expired. If so, it will update him. Otherwise, nothing. > That's all! There is no action with cron. > > There is more understandable name for that. For example, --update-certs. > > The --cron key should only add the script to crontab and nothing more. > > If need to check and update right now plus add to crontab it should look something like this: > > /home/jobe1986/dehydrated/dehydrated --update-certs --cron > What do you think? > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@nlevchuk commented on GitHub (Oct 9, 2018):

But use --update-certs or something like this much better and understandable. @lukas2511 what do you think? Maybe it's time to change? )

@nlevchuk commented on GitHub (Oct 9, 2018): But use `--update-certs` or something like this much better and understandable. @lukas2511 what do you think? Maybe it's time to change? )
Author
Owner

@txr13 commented on GitHub (Oct 10, 2018):

I think it’s perfectly understandable if one reads the readme / help output. You’re using the flag to select cron mode, not to output to crontab.

To explain further, consider that your proposed --update-certs flag is also misleading. It doesn't just update certificates--you also need to use this flag when creating new certificates.

The dehydrated "commands" are better thought of as modes of operation. (You'll note they're listed separately from the available "parameters.") Account mode handles account operations. SignCSR mode does just that--signs a CSR. Revoke mode handles certificate revocations, and so on down the line. Cron mode is the fully-automatic mode, where dehydrated checks the config, assesses certificates, and does the needful, whether that's renewals, new certs, or just peacefully ending execution. It's called cron mode because it's expected to be run from cron--fully-automatic.

Cron mode is also used for creating new certificates. Again, all that you need to do is update the config files and run dehydrated in cron mode, and it will go off and do the needful. You can use that mode from command-line for immediate execution, or wait for your regularly-scheduled cron job to take care of it, as you please.

@txr13 commented on GitHub (Oct 10, 2018): I think it’s perfectly understandable if one reads the readme / help output. You’re using the flag to select cron mode, not to output to crontab. To explain further, consider that your proposed `--update-certs` flag is also misleading. It doesn't just update certificates--you also need to use this flag when creating new certificates. The `dehydrated` "commands" are better thought of as modes of operation. (You'll note they're listed separately from the available "parameters.") Account mode handles account operations. SignCSR mode does just that--signs a CSR. Revoke mode handles certificate revocations, and so on down the line. Cron mode is the fully-automatic mode, where `dehydrated` checks the config, assesses certificates, and does the needful, whether that's renewals, new certs, or just peacefully ending execution. It's called cron mode because it's expected to be run from cron--fully-automatic. Cron mode is also used for creating new certificates. Again, all that you need to do is update the config files and run `dehydrated` in cron mode, and it will go off and do the needful. You can use that mode from command-line for immediate execution, or wait for your regularly-scheduled cron job to take care of it, as you please.
Author
Owner

@nlevchuk commented on GitHub (Oct 11, 2018):

@txr13 if it's like a mode of operation than it should call appropriately - -m, --mode NAME

--mode cron
--mode signCSR

it's more intuitively. But using cron command and don't do for cron anything it's strange :)

@nlevchuk commented on GitHub (Oct 11, 2018): @txr13 if it's like a mode of operation than it should call appropriately - `-m, --mode NAME` ``` --mode cron --mode signCSR ``` it's more intuitively. But using `cron` command and don't do for cron anything it's strange :)
Author
Owner

@lukas2511 commented on GitHub (Oct 20, 2018):

I agree that the name might not be the best, but that's what we got now.

The tool was designed to basically do everything fully automatically, being called by a cron daemon, that's where the name of the switch comes from.

I'm not going to change it as it would result in a lot more trouble than telling the two people who didn't read the --help text what it does.
Adding additional commands would only end up in a lot more confusion.

@lukas2511 commented on GitHub (Oct 20, 2018): I agree that the name might not be the best, but that's what we got now. The tool was designed to basically do everything fully automatically, being called by a cron daemon, that's where the name of the switch comes from. I'm not going to change it as it would result in a lot more trouble than telling the two people who didn't read the `--help` text what it does. Adding additional commands would only end up in a lot more confusion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#382