TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ADAM FUNK
from: CHRIS ELVIDGE
date: 2020-02-20 11:35:00
subject: Re: Controlling the time

On 19/02/2020 16:04, Adam Funk wrote:
> On 2020-02-18, Martin Gregorie wrote:
>
>> On Sun, 16 Feb 2020 15:16:09 +0000, Roger Bell_West wrote:
>>
>>> On 2020-02-16, Adam Funk wrote:
>>>> I want the cron.daiy jobs to run earlier in the morning than they do by
>>>> default.  I used to do this by editing the time in /etc/cron.d/anacron,
>>>> but that no longer works; nor does changing the time in the cron.daily
>>>> line of /etc/crontab.  How is this controlled now?
>>>
>>> Welcome to the systemd snake pit. There will be an undocumented command
>>> somewhere to change it, but why would you want to override systemd's
>>> defaults, which are perfect for every computer and every usage pattern?
>>
>> Look at "man 8 cron" to see how crond is run, including under systemd.
>> These days crond only handles the jobs that run more frequently than
>> daily as well as those with their own run schedule, i.e those the run
>> several times a day or to a more complex run schedule. It also has useful
>> references to other manpages.
>>
>> For jobs that run daily, weekly or monthly, see at "man 8 anacron" for
>> details of the controlling daemon, anacron, and "man anacrontab" to see
>> how to configure anacron, including changing the time of day these jobs
>> will be run at.
>
> I can't find anything there on how to change the start time each day;
> man 8 anacron does say this:
>
>    DEBIAN-SPECIFIC CONFIGURATION
>    On Debian-based systems, anacron will be activated hourly every day
>    from 07:30 local time to 23:30 local time through cron job (on
>    non-systemd systems where cron is installed and enabled) or systemd
>    timer (on systemd-based systems).  On activation, anacron will check
>    if it missed some jobs. If yes, it will start those jobs after a
>    short period of time.
>
> But I don't see how to change the 07:30 start.  I made the following
> change in /etc/cron.d/anacron yesterday
>
> #30 7-23 * * *   root [ -x /etc/init.d/anacron ] && if [ ! -d
/run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi
> 30 5-23 * * *   root [ -x /etc/init.d/anacron ] && if [ ! -d
/run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi
>
> but it still ran at 07:30.
>
>

Did anacron also run at 0530 and 0630?

Look at the "timestamp" files in /var/spool/anacron.

If the timestamp for cron.daily is 0730, then it will next run these at
the next 0730.
Possibly "touch" the timestamp files with 0530?




--

Chris Elvidge, England

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.