[mythtv-users] anacron time change after upgrade to Ubuntu 18.04

Jim Abernathy jfabernathy at gmail.com
Sat Nov 10 12:18:29 UTC 2018


On 11/9/18 8:57 AM, Stephen Worthington wrote:
> On Fri, 9 Nov 2018 08:51:41 -0500, you wrote:
>
>> Now that we've seen the anacron daily changed successfully to 7:30am.  I
>> wanted to see exactly how to accomplish this correctly and document it.
>>
>> So the plan is to change from 7:30am to 5:30am and see if one set of
>> commands will do this.
>>
>> Here is the console output with the commands:
>>
>> jim at mythbuntu:~$ *sudo systemctl edit anacron.timer* # all I changed was
>> the 7 to a 5, and the description.
>> jim at mythbuntu:~$ *sudo systemctl daemon-reload*
>> jim at mythbuntu:~$ *sudo systemctl restart anacron.timer*
>> jim at mythbuntu:~$ *sudo systemctl cat anacron.timer*
>> # /lib/systemd/system/anacron.timer
>> [Unit]
>> Description=Trigger anacron every hour
>>
>> [Timer]
>> OnCalendar=hourly
>> RandomizedDelaySec=5m
>> Persistent=true
>>
>> [Install]
>> WantedBy=timers.target
>>
>> # /etc/systemd/system/anacron.timer.d/override.conf
>> [Unit]
>> Description=Trigger anacron at 05:30, instead of midnight, the default
>> for Ubunt
>>
>> [Timer]
>> OnCalendar=
>> OnCalendar=05:30
>> RandomizedDelaySec=0s
>> Persistent=true
>> jim at mythbuntu:~$ sudo systemctl status anacron.timer
>> ? anacron.timer - Trigger anacron at 05:30, instead of midnight, the
>> default for
>>     Loaded: loaded (/lib/systemd/system/anacron.timer; enabled; vendor
>> preset: en
>>    Drop-In: /etc/systemd/system/anacron.timer.d
>>             ??override.conf
>>     Active: active (waiting) since Fri 2018-11-09 08:44:08 EST; 16s ago
>>    Trigger: Sat 2018-11-10 05:30:00 EST; 20h left
>>
>> Nov 09 08:44:08 mythbuntu systemd[1]: Stopping Trigger anacron at 05:30,
>> instead
>> Nov 09 08:44:08 mythbuntu systemd[1]: Started Trigger anacron at 05:30,
>> instead
>> jim at mythbuntu:~$
>>
>> Do now we wait and see what happens tomorrow.  I will not reboot at this
>> time.
>>
>> Jim A
>>
> That looks good.  The status is showing that anacron.timer will
> trigger at 05:30.  But we really will have to wait and see if it
> actually happens.  For debugging purposes, you can change the time to
> something that is only minutes away, if you do not want to wait that
> long.
> _

So my DB maintenance ran a 5:35am as expected.  So if I want to run all 
my daily maintenance task along with the systems task, but delay that 
from midnight to ~5:30 the steps are:

1. move scripts to the /etc/cron.daily directory

2. sudo systemctl edit anacron.timer  # add the following text when 
editor opens:*
*

[Unit]
Description=Trigger anacron at 05:30, instead of midnight, the default for Ubuntu 18.04

[Timer]
OnCalendar=
OnCalendar=05:30
RandomizedDelaySec=0s
Persistent=true

3. sudo systemctl daemon-reload
4. sudo systemctl restart anacron.timer

So I now have multiple ways of doing all this timed running of the DB 
maintenance. It really boils down to whether all of the maintenance 
needs to be moved because recording/transcoding activity is heavy at 
that time or whether you just need to run your own jobs at a certain time.

Thanks for all the help. I've certainly learned more about cron and anacron.

Jim A


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20181110/0219f015/attachment.html>


More information about the mythtv-users mailing list