小编Gri*_*a S的帖子

使用 UTC 时间时,systemd 计时器无法启动(参数无效)

这是我的计时器:

[Unit]
Description=Do whatever

[Timer]
OnCalendar=daily UTC

[Install]
WantedBy=timers.target
Run Code Online (Sandbox Code Playgroud)

它无法启动并出现以下错误:

Failed to start mytimer.timer: Unit mytimer.timer failed to load: Invalid argument. See system logs and 'systemctl status mytimer.timer' for details.
Run Code Online (Sandbox Code Playgroud)

遗憾的是,systemctl status错误消息没有任何清晰度

但是,如果我删除 UTC 文字,它就可以正常工作:

[Unit]
Description=Do whatever

[Timer]
OnCalendar=daily

[Install]
WantedBy=timers.target
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

该文档描述了 接受的格式OnCalendar,并且表明可以使用UTC。

是的,我尝试使用引号 - 没有帮助。我也尝试使用标准化形式 - 同样的事情

版本:

  • 操作系统:CentOS 7
  • 内核:3.10.0-042stab113.21
  • 系统:systemd-219-19.el7_2.9.x86_64

linux systemd

4
推荐指数
1
解决办法
2251
查看次数

标签 统计

linux ×1

systemd ×1