Systemd
archlinux Wiki
i3wm 普通用户关机 重新安装 polkit 即可
root
- systemctl = systemctl –system
- systemctl enable NetworkManager = systemctl –system enable NetworkManager
- systemctl enable sshd = systemctl enable sshd –system
- systemctl enable update-system.timer = systemctl –system enable update-system.timer
poweroff
| |
reboot
| |
Show system status
| |
List running units
| |
List failed units
| |
List installed unit files
| |
not root
参考archlinux wiki
offers the ability to manage services under the user’s control with a per-user systemd instance,enabling them to start, stop, enable, and disable their own user units
systemctl –user Connect to user service manager
- systemctl –user enable mpd
- systemctl –user start mpd
systemd/Timers
There are many cron implementations, but none of them are installed by default as the base system uses systemd/Timers instead.
archlinux Wiki
systemd.timer
systemd.time 执行时间策略 \
systemd.exec
file path
- /etc/systemd/system/update-system.timer
- /etc/systemd/system/update-system.service
update-system.timer
| |
update-system.service
| |
查看定时任务
| |
开机激活定时器
| |
取消开机激活定时器
| |
手动激活定时器
| |
手动停止定时器
| |
查看定时器状态
| |
OnCalendar
| |
注意 / 仅用于月份
| desc | word | 周 年-月-日 时:分:秒 |
|---|---|---|
| 每分钟 | minutely | *-*-* *:*:00 |
| 从0分钟起每5分钟 | minutely | *-*-* *:00/5:00 |
| 每小时 | hourly | *-*-* *:00:00 |
| 每天 | daily | *-*-* 00:00:00 |
| 每月 | monthly | *-*-01 00:00:00 |
| 每周 | weekly | Mon *-*-* 00:00:00 |
| 每年 | yearly /annually | *-01-01 00:00:00 |
| 每季度 | quarterly | *-01,04,07,10-01 00:00:00 |
| 每半年 | semiannually | *-01,07-01 00:00:00 |
| 九月倒数第一天0点 | *-09~01 00:00:00 | |
| 每年的九月倒数第七天起每过4天后的周一 | Mon *-09~07/4 00:00:00 | |
| 下一个周一或周五 | Mon,Fri *-*-* 00:00:00 | |
| 周一到周五每天0点 | Mon..Fri *-*-* 00:00:00 |