systemd user timers (cron alternative)

After system reinstall I had some issues fixing my user systemd timers. Because I copied the files from backup to .config/systemd/user/ the system yell at me with Failed to execute operation: Invalid argument
After googling I found solution at http://stackoverflow.com/a/33363732/289404

I had disabled timer-{daily,weekly,hourly}.timer

$ systemctl --user list-unit-files
UNIT FILE                  STATE
dbus.service               indirect
mpd.service                disabled
mpdas.service              enabled 
systemd-bus-proxyd.service static
systemd-exit.service       static
dbus.socket                disabled
systemd-bus-proxyd.socket  static
basic.target               static
bluetooth.target           static
busnames.target            static
default.target             static
exit.target                static
paths.target               static
printer.target             static
shutdown.target            static
smartcard.target           static
sockets.target             static
sound.target               static
timer-daily.target         static
timer-hourly.target        static
timer-weekly.target        static
timers.target              static
timer-daily.timer          disabled
timer-hourly.timer         disabled
timer-weekly.timer         disabled

So after

$ rm ~/.config/systemd/user/basic.target.wants/timer-*

and

$ systemctl --user enable timer-weekly.timer
$ systemctl --user enable timer-daily.timer
$ systemctl --user enable timer-hourly.timer

I got the timers enabled

 $ systemctl --user list-unit-files |grep timer
timer-daily.target         static  
timer-hourly.target        static  
timer-weekly.target        static  
timers.target              static  
timer-daily.timer          enabled 
timer-hourly.timer         enabled 
timer-weekly.timer         enabled

Great how-to is at https://blog.higgsboson.tk/2013/06/09/use-systemd-as-a-cron-replacement/

Advertisements

About Michal Zuber

Biker and rollerblader. Owner and developer at http://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/
This entry was posted in linux and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s