acmesh-official / acme.sh

A pure Unix shell script implementing ACME client protocol
https://acme.sh
GNU General Public License v3.0
38.8k stars 4.92k forks source link

Cron job for certificate renewal #5198

Closed Zeni241 closed 3 weeks ago

Zeni241 commented 3 months ago

I have successfully installed SAN as well as wildcard SSL certificate for my domain as root user following this site (https://github.com/acmesh-official/acme.sh/blob/master/README.md). The problem is that every time I have to manually renew the certificates. I have created a cron job using command crontab –e from root folder as a root user. My entry is as bellow: 0 0 * * */root/.acme.sh/ acme.sh --renew -d mydomain.con --force && /root/ systemctl restart nginx && echo "SSL certigicate renewed at $(date )" >> /root/ sslrenewalhistory.txt; But this is not working. I don’t know where I am wrong.

github-actions[bot] commented 3 months ago

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.

szhu25 commented 1 month ago

Typically acme.sh should install a cronjob to the executing user, and it's also documented in the README.md file. 0 0 * * * "/home/user/.acme.sh"/acme.sh --cron --home "/home/user/.acme.sh" > /dev/null

Have you tried to run acme.sh --cron manually and check its output?

Edit: didn't realize this is a two months old thread. Hopefully you found a solution or it might be the right time to process the new renewal

Neilpang commented 3 weeks ago

please use the default cronjob:

acme.sh  --installcronjob