Announcement

Collapse
No announcement yet.

If you use cron jobs and want to change the time Anacron runs...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    If you use cron jobs and want to change the time Anacron runs...

    My Anacron runs at 7:30 but I want it to start earlier - like before I wake up - because I use it to make my daily snapshot. Anacron is fairly new to me and it appears to ignore times you set in crontab.

    There isn't much documentation that I could find about how to change the time anacron activates, but after a little looking around, I discovered this info:

    The way to change anacron execution time is with this command:


    sudo systemctl edit --full anacron.timer

    Then modify the line:


    OnCalendar=*-*-* 07..23:30


    I wanted to move mine up an hour so I used:

    OnCalendar=*-*-* 06..22:30


    Again - no docs I could find, so I assumed this means 6am to 10pm on the half-hour (30 minutes).

    We'll see tomorrow if I'm right.

    Please Read Me

    #2
    OK, finally found more details about the "OnCalendar" entries:

    https://www.freedesktop.org/software...endar%20Events

    Please Read Me

    Comment


      #3
      Mmmm... Interesting!
      It led me to doing a "man systemd-analyze" and in that man page I found
      systemd-analyzedot|dot-Tsvg> systemd.svg
      which produced a very beautiful graph of all the interconnections of systemd components. One has to install graphviz before they can use that command. When run, the command produces
      Code:
      [FONT=monospace][COLOR=#000000]:[/COLOR][COLOR=#5454ff][B]~[/B][/COLOR][COLOR=#000000]$ systemd-analyze dot | dot -Tsvg >systemd.svg  [/COLOR]
         Color legend: black     = Requires 
                       dark blue = Requisite 
                       dark grey = Wants 
                       red       = Conflicts 
                       green     = After [/FONT]
      and appears to hang, but don't dispare. Without closing the Konsole on which that "hang" occurs, simple open FF and then open systemd.svg. What that beautiful graph is missing is the legend, which is printed in the Konsole. If you close the Konsole and then open the systemd.svg file it will only show a small black square in the upper left corner.

      Snowhog, your reference also pointed me to a host of man pages about systemd which I had never read but contain a treasure trove of useful info.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        My edit worked as I had hoped. Today's snapshot was taken at 6:38am

        Please Read Me

        Comment

        Working...
        X