저는 systemd를 사용하여 매일 docker 레지스트리를 정리하려고 합니다.
이것은 내 파일 내용입니다.
[Unit]
Description=registry-gc
[Timer]
OnCalendar=41 15 * * *
Persistent=true
[Install]
WantedBy=timers.target
실행할 때 다음 오류가 발생합니다: sudo systemctl statusregistry-gc.timer
● registry-gc.timer - registry-gc
Loaded: bad-setting (Reason: Unit registry-gc.timer has a bad unit file setting.)
Active: inactive (dead)
Trigger: n/a
Triggers: ● registry-gc.service
/etc/systemd/system/registry-gc.timer:5: Failed to parse calendar specification, ignoring: 41 15 * * *
registry-gc.timer: Timer unit lacks value setting. Refusing.
내가 물어보면: systemctl list-timers --all 내가 얻는 것은:
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2022-09-02 16:34:04 CEST 42min left Fri 2022-09-02 15:34:37 CEST 16min ago anacron.timer anacron.service
Fri 2022-09-02 22:37:19 CEST 6h left Fri 2022-09-02 06:07:37 CEST 9h ago fwupd-refresh.timer fwupd-refresh.service
Sat 2022-09-03 00:00:00 CEST 8h left Fri 2022-09-02 00:00:58 CEST 15h ago logrotate.timer logrotate.service
Sat 2022-09-03 00:00:00 CEST 8h left Fri 2022-09-02 00:00:58 CEST 15h ago man-db.timer man-db.service
Sat 2022-09-03 01:32:55 CEST 9h left Fri 2022-09-02 12:47:34 CEST 3h 3min ago apt-daily.timer apt-daily.service
Sat 2022-09-03 06:40:33 CEST 14h left Fri 2022-09-02 06:49:58 CEST 9h ago apt-daily-upgrade.timer apt-daily-upgrade.service
Sat 2022-09-03 08:48:51 CEST 16h left Fri 2022-09-02 14:38:46 CEST 1h 12min ago motd-news.timer motd-news.service
Sat 2022-09-03 12:09:58 CEST 20h left Fri 2022-09-02 12:09:58 CEST 3h 41min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Sun 2022-09-04 03:10:16 CEST 1 day 11h left Sun 2022-08-28 03:10:37 CEST 5 days ago e2scrub_all.timer e2scrub_all.service
Mon 2022-09-05 00:00:00 CEST 2 days left Mon 2022-08-29 00:00:58 CEST 4 days ago fstrim.timer fstrim.service
n/a n/a n/a n/a registry-gc.timer registry-gc.service
cron 형식을 사용하여 시간을 설정합니다. 매일 15시 41분에 실행하고 싶습니다. 어떤 아이디어가 있나요?