我已经安装了用于加密密钥更新的certbot。这个很管用。
当我在/etc/log/letsencrypt上检查我的日志时,我看到它每天运行两次。午夜前后和中午左右。
我想在清晨的某个地方每天只运行一次。
为了控制certbot的运行,我从cron作业中删除了所有条目。但出乎意料的是,它仍在运行。
那么certbot是怎么开始的?
额外信息:
当我运行一个脚本来显示所有的cron作业时,我得到以下内容:( script:How do I list all cron jobs for all users? )
mi h d m w user command
0 3 * * 1 root /usr/bin/rsnapshot weekly
0 */4 * * * root /usr/bin/rsnapshot hourly
16 10 * * * root test -x /etc/cron.daily/popularity-contest && /etc/cron.daily/popularity-contest --crond
25 6 * * * root /etc/cron.daily/apache2
25 6 * * * root /etc/cron.daily/apt-compat
25 6 * * * root /etc/cron.daily/aptitude
25 6 * * * root /etc/cron.daily/automysqlbackup
25 6 * * * root /etc/cron.daily/bsdmainutils
25 6 * * * root /etc/cron.daily/dpkg
25 6 * * * root /etc/cron.daily/exim4-base
25 6 * * * root /etc/cron.daily/logrotate
25 6 * * * root /etc/cron.daily/man-db
25 6 * * * root /etc/cron.daily/mlocate
25 6 * * * root /etc/cron.daily/ntp
25 6 * * * root /etc/cron.daily/passwd
25 6 * * * root /etc/cron.daily/popularity-contest
25 6 * * * root /etc/cron.daily/tomcat8
30 2 1 * * root /usr/bin/rsnapshot monthly
30 3 * * * root /usr/bin/rsnapshot daily
47 6 * * 7 root /etc/cron.weekly/man-db我发现的certbot文件是/etc/cron.d中的certbot文件。
它包含以下内容:
#0 4 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew我把它注释掉了(用#)
我的系统是debian:
Debian GNU/Linux 9
发布于 2018-07-07 14:34:34
我在Ubuntu16.04+ nginx中使用certbot,有两个地方可以检查与Certbot相关的工作
1) /etc/cron.d/certbot
给你
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew && nginx -s reload
2)系统定时器
运行commnad:$sudo systemctl列表定时器
和见输出
太阳2018-07-08 00:46:59 EEST 7h左Sat 2018-07 12:36:26 EEST 4小时51分钟前certbot.timer certbot.service
然后
3)
在systemctl运行Certbot时,转到检查控制时间的文件
/etc/systemd/system/timers.target.wants/certbot.timer
的符号链接。
/lib/systemd/system/certbot.timer
注意这一行,定义时间+随机秒(为目的设置一个随机时间,以避免同时对服务器施加压力)
OnCalendar=--* 00,12:00:00
RandomizedDelaySec=3600
https://stackoverflow.com/questions/49645833
复制相似问题