计划任务(cron)与 Cron 管理器

计划任务(cron)与 Cron 管理器(Cron Jobs & Cron Manager)

目录

有些 Wavelog 任务最好按固定日程执行,以保持系统顺畅运行。为了避免管理员反复执行这些任务,你可以设置计划任务来自动完成。有两种方式设置这些周期性任务。

使用 Cron 管理器

自 1.6 版本起,Wavelog 自带便捷的 WebUI Cron 管理器。管理员可以在「管理」菜单的「Cron 管理器」子菜单中查看周期性任务的信息。Cron 管理器至少需要 PHP 8.1 版本才能工作。

警告

要让 Cron 管理器正常工作,你需要设置一个每分钟运行的真实计划任务。在 Docker 安装中这一步已经完成了!

# Wavelog Master Cron
* * * * * curl --silent https://<URL-To-Wavelog>/index.php/cron/run &>/dev/null

设置好这个主计划任务后,你至少要等一分钟才能在 Cron 管理器中看到更多细节。等待 60 秒后重新加载页面。现在你可以使用常见的 cron 格式(更多信息见此)编辑任务的间隔,或一键禁用/启用任务。

警告

目前,尚不支持通过 WebUI 添加/删除任务。

关于没有有效 SSL 证书的纯 IP 地址(自签名证书)的说明

提示

Cron 管理器目前需要纯 HTTP 或带有有效 SSL 证书的 HTTPS。如果你使用带自签名证书的 HTTPS,需要在 config.php 中设置 $config['cron_allow_insecure'] = true;。这会给 curl 逻辑加上 -k(--insecure)参数。你还需要把这个参数加到主计划任务中。

针对 Docker 安装的重要提示

提示

默认情况下,Cron 管理器进行内部调用时使用 config.php 中配置为 $config['base_url'] 的 URL。如果该 URL 从安装 Wavelog 的主机无法访问(尤其是在使用 Docker 部署时),Cron 管理器就会失败。这种情况下,可以通过 config.php 中的 $config['local_url'] 配置一个用于本地内部调用的 URL。对于 Docker 容器内的部署,以下片段即可实现:

$config['local_url'] = 'http://localhost/';

手动计划任务(强烈不推荐)

如果你不想使用 Cron 管理器,可以使用常规的服务器计划任务。下面列出了推荐的计划任务。

# Upload QSOs to Club Log (ignore cron job if this integration is not required)
3 */6 * * * curl --silent https://<URL-To-Wavelog>/index.php/clublog/upload &>/dev/null

# Upload QSOs to LoTW if certs have been provided every hour. (Does Up- AND Download)
0 */1 * * * curl --silent https://<URL-To-Wavelog>/index.php/lotw/lotw_upload &>/dev/null

# Upload QSOs to QRZ Logbook (ignore cron job if this integration is not required)
6 */6 * * * curl --silent https://<URL-To-Wavelog>/index.php/qrz/upload &>/dev/null

# Download QSOs from QRZ Logbook (ignore cron job if this integration is not required)
18 */6 * * * curl --silent https://<URL-To-Wavelog>/index.php/qrz/download &>/dev/null

# Upload QSOs to HRD Logbook (ignore cron job if this integration is not required)
12 */6 * * * curl --silent https://<URL-To-Wavelog>/index.php/hrdlog/upload &>/dev/null

# Upload/download QSOs to/from Eqsl (ignore cron job if this integration is not required)
9 */6 * * * curl --silent https://<URL-To-Wavelog>/index.php/eqsl/sync &>/dev/null

# Update LOTW Users Activity
# Update only once a week as data is only provided weekly at ~ 1000z Sundays
10 1 * * 1 curl --silent https://<URL-To-Wavelog>/index.php/update/lotw_users &>/dev/null

# Update Clublog SCP Database File
@weekly curl --silent https://<URL-To-Wavelog>/index.php/update/update_clublog_scp &>/dev/null

# Update DOK File for autocomplete
@monthly curl --silent https://<URL-To-Wavelog>/index.php/update/update_dok &>/dev/null

# Update SOTA File for autocomplete
@monthly curl --silent https://<URL-To-Wavelog>/index.php/update/update_sota &>/dev/null

# Update WWFF File for autocomplete
@monthly curl --silent https://<URL-To-Wavelog>/index.php/update/update_wwff &>/dev/null

# Update POTA File for autocomplete
@monthly curl --silent https://<URL-To-Wavelog>/index.php/update/update_pota &>/dev/null

# Update DXCC entities every two months
20 0 1 */2 * curl --silent https://<URL-To-Wavelog>/index.php/update/dxcc &>/dev/null

# Check for newer release of Wavelog once a day and display banner on dashboard if found.
# You can remove the pipe to /dev/null to receive a notification/email by cron if an update was found.
45 4 * * * curl --silent https://<URL-To-Wavelog>/index.php/update/version_check &>/dev/null
Wavelog 手册(中文版) / 计划任务(cron)与 Cron 管理器 0 字 0 行 bg8lng
2026-10-21T12:42:36.198617706Z 2026-10-21T12:43:51.755103879Z