Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify –domain with –cron option #3869

Closed
OzTechGeek opened this issue Jan 1, 2022 · 4 comments
Closed

Specify –domain with –cron option #3869

OzTechGeek opened this issue Jan 1, 2022 · 4 comments

Comments

@OzTechGeek
Copy link

Hi All,

Wondering if there is a way to specify the “—domain” option when using the “—cron” option?

The reason I ask is, I changed servers at my hosting provider and for some reason they have their SSH Timeout set to 5 minutes, but it’s set for the session itself and not as an idle timeout, I have tried getting them to change it or have a setting specific to my account, but they said it’s a global setting and cannot be set on a per user basis.

And this is where the problem occurs, I have 6 domain names which I use acme.sh for, the problem is when the cron job runs, because of sleep tiemouts etc during renewal. I can only get about 3 domains to renew automatically, I have to go in and manually do the rest each time the cron job runs.

My current crontab looks like this:

"$HOME/.acme.sh/acme.sh" --cron --home "$HOME/.acme.sh" --config-home "$HOME/.acme.sh/config" –force

I tried setting a cron job for each domain at different time intervals, but the problem is I do not get any Pushover notifications when the cron job runs, unless I’m missing an option somewhere, I tried using this crontab entry for each domain:

"$HOME/.acme.sh/acme.sh" --renew --domain $DOMAIN_NAME ; "$HOME/.acme.sh/acme.sh" --deploy --deploy-hook cpanel_uapi --domain $DOMAIN_NAME

Is there a way to specify the “—domain” option in the “—cron” command line, or if I have to do the “—renew” and “—deploy” options for each domain, that is fine, but how do I get notifications to work also?

What commands does the “—cron” option execute?

Thanks for your time and help

@Neilpang
Copy link
Member

Neilpang commented Jan 1, 2022

don't add --force option for --cron command. It will issue certs everyday.

What commands does the “—cron” option execute?

don't add any other options to --cron. The --cron command only trys to : 1. load the configs of every certs. 2. and renew the certs if needed.

There can be many certs(with different domains) on your system, the --cron command has to check all of them one by one. It doesn't make any sense to add --domain for --cron.

@Neilpang Neilpang closed this as completed Jan 1, 2022
@OzTechGeek
Copy link
Author

@Neilpang

Thanks for the reply, I should clarify, that my actual cron job only runs on the 1st of every month at 12am, the actual crontab looks like this:

0 0 1 * * "$HOME/.acme.sh/acme.sh" --cron --home "$HOME/.acme.sh" --config-home "$HOME/.acme.sh/config" --force

Since I need to space out the renewals becuase of the cron job getting terminated by my hosting provider after 5 minutes, is there a way to enable notifications when using

"$HOME/.acme.sh/acme.sh" --renew --domain $DOMAIN_NAME ; "$HOME/.acme.sh/acme.sh" --deploy --deploy-hook cpanel_uapi --domain $DOMAIN_NAME

Or are notifications only enabled with --cron?

Thanks again.

Neilpang added a commit that referenced this issue Jan 3, 2022
@Neilpang
Copy link
Member

Neilpang commented Jan 3, 2022

please upgrade to the latest dev branch, it can send notifications in "renew".

acme.sh --upgrade -b dev

Let me know if this is what you want.

Thanks

Neilpang added a commit that referenced this issue Jan 6, 2022
@OzTechGeek
Copy link
Author

@Neilpang

Thank You, tested and verified from both command line and a cron job, works like a charm :)

DOMAIN_NAME="domain.tld" ; $HOME/.acme.sh/acme.sh --home $HOME/.acme.sh --config-home $HOME/.acme.sh/config --renew --domain $DOMAIN_NAME

The above command performs the following perfectly:

  1. Renews certificate for specified domain
  2. Deploys renewed certificate for specified domain
  3. Sends Pushover notification of renewal for specified domain

Thanks again much appriciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants