大网数据广告活动
服务器运维问答

Can't find certbot cron job after successful installation

· 52CE 我爱测

I've developed a REST API in Node and installed nginx as reverse proxy in front of that in order to handle the SSL certificate from Letsencrypt. It's the first time I've set up nginx but everything seems to work as intended. The …

问题原文

原帖链接 · Martin Gunnarsson · CC BY-SA 4.0

I've developed a REST API in Node and installed nginx as reverse proxy in front of that in order to handle the SSL certificate from Letsencrypt. It's the first time I've set up nginx but everything seems to work as intended. The certbot installation was uneventful and the certificate is in place and works. My only concern is that I can't see any evidence of auto-renewal in place.

The Certbot docs say:

The command to renew certbot is installed in one of the following locations:

/etc/crontab/
/etc/cron.*/*
systemctl list-timers

I've checked all the above locations but there are no traces of certbot anywhere. Running sudo certbot renew --dry-run works without any error messages but no cron job or timer is created as far as I can see. Are the docs outdated or is the problem my lacking Linux skills?

The server is running Ubuntu 20.04.1 LTS and nginx/1.18.0 (Ubuntu).

已采纳解答

原帖链接 · RobbieCrash · CC BY-SA 4.0

By default on Ubuntu 18.04+, certbot should add /etc/cron.d/certbot and run every 12 hours (*/12). If you do not see a file there, you can create your own cronjob by doing sudo crontab -e and adding a simple job that follows the template instructions. You'll need to be sure that cron understands where certbot lives, or use the full path. Generally the full path is a better bet than hoping cron knows your PATH. By default certbot should be at /usr/local/bin/certbot

You can verify where certbot lives by doing which certbot

The command you should enter in your cron job will be /path/to/certbot renew

To run a midnightly renewal every Day of the Month, Every Month, on every Day of the Week, if everything is default and you're using Ubuntu, the full line you'd add in cron would be:

# m h DoM Mon DoW        command:
  0 0 *   *   *          /usr/local/bin certbot renew

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-10-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。