mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
Command '--cron' meaning #382
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 ?
@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>&1Or if you wish to receive the output of dehydrated as an email then you could use:
@nlevchuk commented on GitHub (Oct 9, 2018):
But it's not understandable. And it's problem. Not for script execution, but for UI.
/home/jobe1986/dehydrated/dehydrated --croncommand do?That's all! There is no action with cron.
There is more understandable name for that. For example, --update-certs.
The
--cronkey 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:
What do you think?
@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.
@nlevchuk commented on GitHub (Oct 9, 2018):
But use
--update-certsor something like this much better and understandable. @lukas2511 what do you think? Maybe it's time to change? )@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-certsflag 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, wheredehydratedchecks 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
dehydratedin 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.@nlevchuk commented on GitHub (Oct 11, 2018):
@txr13 if it's like a mode of operation than it should call appropriately -
-m, --mode NAMEit's more intuitively. But using
croncommand and don't do for cron anything it's strange :)@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
--helptext what it does.Adding additional commands would only end up in a lot more confusion.