today
Thu 2015
-
08
-
13 00:00:00
tomorrow
Thu 2015
-
08
-
14 00:00:00
hourly
*
-
*
-
* *:00:00
daily
*
-
*
-
* 00:00:00
weekly
Mon *
-
*
-
* 00:00:00
monthly
*
-
*
-
01 00:00:00
+3h10m
Thu 2015
-
08
-
13 17:00:00
2015
-
08
-
16
Sun 2015
-
08
-
16 00:00:00
.
一个循环时间运作的案例
现在假设这样:
.
开机后
2
小时开始执行一次这个
backup.service
.
自从第一次执行后,未来我每两天要执行一次
backup.service
好了,那么应该如何处理这个½本呢?可以这样做喔!
[root@study ~]#
vim /etc/systemd/system/backup.timer
[Unit]
Description=backup my server timer
[Timer]
OnBootSec=2hrs
OnUnitActiveSec=2days
[Install]
WantedBy=multi
-
user.target
#
只要
这样设
定就
够
了!
储
存离
开
吧!
[root@study ~]#
systemctl daemon
-
reload
[root@study ~]#
systemctl enable backup.timer
[root@study ~]#
systemctl restart backup.timer
[root@study ~]#
systemctl list
-
unit
-
files | grep backup
backup.service disabled
#
这个
不需要
启动
!只要
enable backup.timer
即可!
backup.timer enabled
[root@study ~]#
systemctl show timers.target