我正在尝试用计时器编写一个服务。但它没有被执行:
例如@host /etc/systemd/system/mbsync.service:
[Unit]
Description=Mailbox synchronisation service for user example
[Service]
Type=oneshot
ExecStart=/usr/bin/mbsync -aV
User=example
StandardOutput=syslog
StandardError=syslog例@host /etc/systemd/system/mbsync.timer:
[Unit]
Description=Mailbox synchronisation timer
[Timer]
OnBootSec=10s
OnCalendar=*:00/2
[Install]
WantedBy=default.target我是这样开始的:
systemctl daemon-reload
systemctl enable mbsync.timer
systemctl start mbsync.timer但我只得到:
systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2015-11-30 11:50:00 CET 10s ago Mon 2015-11-30 11:50:07 CET 2s ago mbsync.timer mbsync.service发布于 2015-11-30 19:57:48
您的计时器已被执行,但它可能无法满足您的要求。您应该使用systemctl status -l mbsync.service检查日志,并相应地优化您的.mbsyncrc。
我发现这些资源很有用:
特别是第二个用户单元文件,这是使用PassCmd "gpg ..."时所必需的。
https://unix.stackexchange.com/questions/246187
复制相似问题