/etc/systemd/system
내가 가진 디렉토리 에는 다음이 있습니다.
rsnapshot-backup.service
다음 내용을 포함하는 파일:
[Unit]
Description=rsnapshot backup automation [cron like]
[Service]
Nice=19
IOSchedulingClass=2
IOSchedulingPriority=7
ExecStart=/usr/bin/notify-send "Rsnapshot Hourly Backup In Progress"
rsnapshot-backup.timer
다음 내용을 포함하여 파일을 제출 하세요 .
[Unit]
Description=hourly rsnapshot backup
[Timer]
OnCalendar=*-*-* *:43:00
Persistent=true
[Install]
WantedBy=timers.target
notify-send
그런데 그게 실행되는 걸 못 봤어요 ? 무엇이 잘못될 수 있나요?
systemctl list-timers
다음을 제공합니다:
NEXT LEFT LAST PASSED UNIT ACTIVATES
Sat 2014-08-16 09:43:00 CEST 2min 37s left Sat 2014-08-16 09:31:18 CEST 9min ago rsnapshot-backup.timer rsnapshot-backup.service
systemctl status rsnapshot-backup.service
다음을 제공합니다:
● rsnapshot-backup.service - rsnapshot backup automation [cron like]
Loaded: loaded (/etc/systemd/system/rsnapshot-backup.service; static)
Active: inactive (dead) since Sat 2014-08-16 09:31:21 CEST; 11min ago
Process: 228 ExecStart=/usr/bin/notify-send Rsnapshot Hourly Backup In Progress (code=exited, status=0/SUCCESS)
Main PID: 228 (code=exited, status=0/SUCCESS)
systemctl status rsnapshot-backup.timer
다음을 제공합니다:
● rsnapshot-backup.timer - hourly rsnapshot backup
Loaded: loaded (/etc/systemd/system/rsnapshot-backup.timer; enabled)
Active: active (waiting) since Sat 2014-08-16 09:31:16 CEST; 12min ago
편집하다
이렇게 하면 journalctl -u rsnapshot-backup
서비스가 성공적으로 시작되었음을 확인할 수 있지만 아무 것도 표시되지 않습니다(알림 전송).
-- Reboot --
Aug 16 09:43:14 ----------------- systemd[1]: Starting rsnapshot backup automation [cron like]...
Aug 16 09:43:14 ----------------- systemd[1]: Started rsnapshot backup automation [cron like].
Aug 16 10:00:06 ----------------- systemd[1]: Starting rsnapshot backup automation [cron like]...
Aug 16 10:00:07 ----------------- systemd[1]: Started rsnapshot backup automation [cron like].
Aug 16 10:19:04 ----------------- systemd[1]: Starting rsnapshot backup automation [cron like]...
Aug 16 10:19:04 ----------------- systemd[1]: Started rsnapshot backup automation [cron like].