systemd/Timers

archlinux를 기본설치하면 cron이 설치되지 않는다.

cronie 를 설치할까하다, systemd/Timers 를 이용하여 매일 package를 업데이트하도록 설정한다.

[arch@seobi.gq system]$ cd /etc/systemd/system
[arch@seobi.gq system]$ cat pacsyu.service
[Unit]
Description=package upgrade

[Service]
ExecStart=pacman -Syu --noconfirm && yes|pacman -Scc

[arch@seobi.gq system]$ cat pacsyu.timer
[Unit]
Description=package upgrade timer

[Timer]
OnBootSec=1min
OnCalendar=*-*-* 4:0:0

[Install]
WantedBy=multi-user.target

[arch@seobi.gq system]$ sudo systemctl enable pacsyu.timer
[arch@seobi.gq system]$ sudo systemctl start pacsyu.timer
[arch@seobi.gq system]$ systemctl list-timers
NEXT                        LEFT     LAST                        PASSED   UNIT                     >
Fri 2022-06-24 18:12:18 KST 8h left  Thu 2022-06-23 18:12:18 KST 15h ago  systemd-tmpfiles-clean.ti>
Sat 2022-06-25 00:00:00 KST 14h left Fri 2022-06-24 00:00:38 KST 9h ago   shadow.timer             >
Sat 2022-06-25 04:00:00 KST 18h left Fri 2022-06-24 09:46:33 KST 7min ago pacsyu.timer             >

3 timers listed.
Pass --all to see loaded but inactive timers, too.

참고 : https://wiki.archlinux.org/title/Systemd/Timers

답글 남기기