You are not logged in.

#1 2020-11-30 11:19:26

justm3
Member
Registered: 2019-11-12
Posts: 56

[SOLVED] anacron-question

Hi all,

I noticed that anacron is triggered on the first minute of every hour defined in START_HOURS_RANGE.

Is that correct? And if so how can I redefine the triggering minute?

Tks in advance.

Last edited by justm3 (2020-12-01 04:10:32)

Offline

#2 2020-11-30 13:13:53

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,392

Re: [SOLVED] anacron-question

Please post the contents of  your /etc/anacrontab .
If START_HOURS_RANGE is set elsewhere, also post the file that is in.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2020-11-30 14:11:31

justm3
Member
Registered: 2019-11-12
Posts: 56

Re: [SOLVED] anacron-question

Here is the file

cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=15
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22

#period in days   delay in minutes   job-identifier   command
1    5    cron.daily        nice run-parts /etc/cron.daily
7    25    cron.weekly        nice run-parts /etc/cron.weekly
@monthly 45    cron.monthly        nice run-parts /etc/cron.monthly

Offline

#4 2020-11-30 15:06:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,693

Re: [SOLVED] anacron-question

anacron is triggered

The daemon itself or the jobs (or some of them - which?)?

Offline

#5 2020-11-30 15:17:52

justm3
Member
Registered: 2019-11-12
Posts: 56

Re: [SOLVED] anacron-question

The daemon itself.

And then cron.daily/backup where I have my script.

But why does it trigger on the first minute after hour's completion? Is it "touchable" in any way?

Offline

#6 2020-11-30 15:27:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,693

Re: [SOLVED] anacron-question

Well, how do you invoke anacron? crontab?
(Though the backup script should only be run once per day, maybe you've an overlapping crontab entry for the dir?)

Offline

#7 2020-11-30 15:39:02

justm3
Member
Registered: 2019-11-12
Posts: 56

Re: [SOLVED] anacron-question

No crontab entry.
Just the script in /etc/cron.daily.

Yes it runs once a day and tbh I am quite happy with it.
It is just that I want to know if the triggering of the daemon can be tinkered.

Because man shed no light, I did a couple of searches but could not come up with anything.
I was hoping that you people might have a clue.
Never mind, I don't want to take up any more of your time.
I really appreciate the interest though.

Offline

#8 2020-11-30 15:46:07

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,693

Re: [SOLVED] anacron-question

anacron doesn't start by itself, you've to actively trigger it *somehow*.
This could be a systemd timer or a crontab entry and if you run "anacron -f" it will also ignore timestamps and just run the scripts everytime.

cat /etc/crontab
pidof crond
crontab -l
sudo corontab -l
systemctl list-timers --all

Offline

#9 2020-11-30 16:08:08

justm3
Member
Registered: 2019-11-12
Posts: 56

Re: [SOLVED] anacron-question

cat /etc/crontab
cat: /etc/crontab: No such file or directory

pidof crond
402

crontab -l
no crontab for user

sudo crontab -l
no crontab for root

systemctl list-timers --all
NEXT                        LEFT                LAST                        PASSED             UNIT                         ACTIVATES                     
Tue 2020-12-01 00:00:00 EET 5h 56min left       Mon 2020-11-30 12:51:34 EET 5h 12min ago       man-db.timer                 man-db.service               
Tue 2020-12-01 00:00:00 EET 5h 56min left       Mon 2020-11-30 12:51:34 EET 5h 12min ago       shadow.timer                 shadow.service               
Tue 2020-12-01 16:18:17 EET 22h left            Mon 2020-11-30 16:18:17 EET 1h 45min ago       systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Sat 2020-12-05 15:00:00 EET 4 days left         Mon 2020-11-09 22:21:09 EET 2 weeks 6 days ago pamac-cleancache.timer       pamac-cleancache.service     
Tue 2020-12-08 16:59:16 EET 1 weeks 0 days left Mon 2020-11-30 13:27:38 EET 4h 36min ago       pkgstats.timer               pkgstats.service             

5 timers listed.

Offline

#10 2020-11-30 17:03:34

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,392

Re: [SOLVED] anacron-question

$ pacman -F anacrontab
core/cronie 1.5.5-1
    etc/anacrontab
$

check /etc/cron.d/ folder


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#11 2020-11-30 17:51:38

justm3
Member
Registered: 2019-11-12
Posts: 56

Re: [SOLVED] anacron-question

@ Lone_Wolf

So you solved the mystery.

0hourly is the answer !
I can't believe it.
I changed the value of 01. But I got to go asap. Will check later with ssh.
Awesome.

You are da man smile

Offline

Board footer

Powered by FluxBB