• 5 Posts
  • 6 Comments
Joined 2 years ago
cake
Cake day: December 30th, 2023

help-circle


  • MoLoPoLY@discuss.tchncs.deOPtoLinux Questions@lemmy.zipSystemd Timer units
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    Sorry, i have to ask again. I actually thought I had solved the problem. However, today I discovered that the jobs are overdue and have not been started for several days. When I display the timers with systemctl --user list-timers, I see that the NEXT column is empty::

    NEXT LEFT LAST                         PASSED UNIT                  ACTIVATES              
    -       - Sun 2026-02-01 20:01:48 CET       - backup.timer  backup.service
    

    Since there is no NEXT date, the timer/service will probably not be restarted. The timer unit looks like this:

    [Unit]
    Description="Backup to remote"
    
    [Timer]
    OnUnitActiveSec=3d
    Persistent=true
    
    [Install]
    WantedBy=default.target
    

    As you can see, I am well over the 3 days. When I call systemctl --user status backup.timer, I get:

     backup.timer - "Backup to remote"
         Loaded: loaded (/home/username/.config/systemd/user/backup.timer; enabled; preset: enabled)
        Drop-In: /home/username/.config/systemd/user/backup.timer.d
         Active: active (elapsed) since Fri 2026-02-13 16:53:31 CET; 7min ago
     Invocation: 95ae3860c50a454b98078fc2ce3eb3c5
        Trigger: n/a
       Triggers:  backup.service
    

    To me, this looks perfectly “normal.” The only thing that puzzles me is the Active line. Why is the current date (Fri 2026-02-13 16:53:31 CET) set there and not the date on which the job last ran (Sun 2026-02-01 20:01:48 CET)? The NEXT column fills up again when I start systemctl --user restart backup.service. The job is then executed immediately and the column is filled. However, after rebooting the laptop, the column is empty again and the job is no longer started at the given intervals.