2

I would like to create a timer that launch a command every 2 months (the first of the month) I already do that with a cron, but I would like to do the same with systemd and get rid of cron.

I have a problem because when I start my timer, systemd refused to activate it with the following error:

systemd[1]: Starting Start my timer.
systemd[1]: myservice.timer failed to enter waiting state: Invalid argument
systemd[1]: Failed to start Start my timer
systemd[1]: Unit myservice.timer entered failed state.

I used the two following units:

myservice.timer

[Unit]
Description=Start my timer

[Timer]
OnCalendar=*-01/2-01 00:00:01
Persistent=true
WakeSystem=true

[Install]
WantedBy=timers.target

myservice.service

[Unit]
Description=Start my command

[Service]
Type=oneshot
ExecStart=/usr/local/mycommand.sh

[Install]
WantedBy=multi-user.target

I suppose it doesn't work because it miss a parameter or the OnCalendar parameter is not good. I am on Debian Jessie.

Thank you.

Guillaume
  • 121
  • 3

0 Answers0