systemctl para iniciar o trabalho cron-like

1

No diretório /etc/systemd/system , tenho:

rsnapshot-backup.service file, com o seguinte conteúdo:

[Unit]
Description=rsnapshot backup automation [cron like]

[Service]
Nice=19
IOSchedulingClass=2
IOSchedulingPriority=7
ExecStart=/usr/bin/notify-send "Rsnapshot Hourly Backup In Progress"

e rsnapshot-backup.timer , com o seguinte conteúdo:

[Unit]
Description=hourly rsnapshot backup

[Timer]
OnCalendar=*-*-* *:43:00
Persistent=true

[Install]
WantedBy=timers.target

Mas não vejo notify-send ser acionado? O que pode estar errado?

systemctl list-timers dá:

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 dá:

● 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 dá:

● 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

EDITAR Fazendo journalctl -u rsnapshot-backup , posso confirmar que o serviço foi successfuly iniciado, no entanto nada visto em exibição (notificar-enviar) ..

-- 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].
    
por branquito 16.08.2014 / 09:47

0 respostas

Tags