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.

  • For "every 2 months" your OnCalendar should be *-01,03,05,07,09,11-01 00:00:01 – don_crissti Feb 16 '16 at 21:34
  • Nope, I already try that. Still doesn't work ! – Guillaume Feb 17 '16 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.