Debian 和 Certbot:包在哪里安装 cron 作业?

T. *_*mas 7 cron debian package-management certbot

我按照 certbot.eff.org 上的说明安装了 python-certbot-apache 包,但找不到它应该设置的 cron 作业的任何条目。

您系统上的 Certbot 软件包带有一个 cron 作业,它会在您的证书到期之前自动更新您的证书。由于 Let's Encrypt 证书的有效期为 90 天,因此强烈建议您利用此功能。 来自:https : //certbot.eff.org/#debianjessie-apache

我在哪里可以找到这个 cron 工作?我试过'crontab -l',有和没有sudo,但没有运气。

我了解如何运行 cron 作业来更新证书;我的问题是:这个包安装的 cron 作业在哪里?安装了吗

Rui*_*iro 10

在任何 Debian 衍生版本中,要列出为您通常执行的软件包安装的文件dpkg -L

所以在你的情况下:

dpkg -L python-certbot-apache 
Run Code Online (Sandbox Code Playgroud)

这是给你安装的所有文件的列表,以及安装位置。

您还可以从 packages.debian.org 请求文件列表

来自https://packages.debian.org/stretch/all/python-certbot-apache/filelist

/usr/lib/python2.7/dist-packages/certbot_apache-0.10.2.egg-info/PKG-INFO
/usr/lib/python2.7/dist-packages/certbot_apache-0.10.2.egg-info/dependency_links.txt
/usr/lib/python2.7/dist-packages/certbot_apache-0.10.2.egg-info/entry_points.txt
/usr/lib/python2.7/dist-packages/certbot_apache-0.10.2.egg-info/requires.txt
/usr/lib/python2.7/dist-packages/certbot_apache-0.10.2.egg-info/top_level.txt
/usr/lib/python2.7/dist-packages/certbot_apache/__init__.py
/usr/lib/python2.7/dist-packages/certbot_apache/augeas_configurator.py
/usr/lib/python2.7/dist-packages/certbot_apache/augeas_lens/httpd.aug
/usr/lib/python2.7/dist-packages/certbot_apache/centos-options-ssl-apache.conf
/usr/lib/python2.7/dist-packages/certbot_apache/configurator.py
/usr/lib/python2.7/dist-packages/certbot_apache/constants.py
/usr/lib/python2.7/dist-packages/certbot_apache/display_ops.py
/usr/lib/python2.7/dist-packages/certbot_apache/obj.py
/usr/lib/python2.7/dist-packages/certbot_apache/options-ssl-apache.conf
/usr/lib/python2.7/dist-packages/certbot_apache/parser.py
/usr/lib/python2.7/dist-packages/certbot_apache/tls_sni_01.py
/usr/share/doc/python-certbot-apache/changelog.Debian.gz
/usr/share/doc/python-certbot-apache/copyright
Run Code Online (Sandbox Code Playgroud)

似乎没有为包自动添加 cron 作业。

您还需要安装软件包 certbot

sudo apt-get install certbot
Run Code Online (Sandbox Code Playgroud)

文件列表:

/etc/cron.d/certbot
/lib/systemd/system/certbot.service
/lib/systemd/system/certbot.timer
/usr/bin/certbot
/usr/bin/letsencrypt
/usr/share/doc/certbot/README.rst.gz
/usr/share/doc/certbot/changelog.Debian.gz
/usr/share/doc/certbot/changelog.gz
/usr/share/doc/certbot/copyright
/usr/share/man/man1/certbot.1.gz
/usr/share/man/man1/letsencrypt.1.gz
Run Code Online (Sandbox Code Playgroud)

所以从最后一个包开始,安装的 crontab 文件实际上是/etc/cron.d/certbot用于 crontab 的,你有 /lib/systemd/system/certbot.service+/lib/systemd/system/certbot.timer用于 systemd