<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 4, 2019 at 12:28 AM Stephen Worthington <<a href="mailto:stephen_agent@jsw.gen.nz">stephen_agent@jsw.gen.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 3 May 2019 18:48:33 -0400, you wrote:<br>
<br>
>daryl@trieli:~$ cat /var/log/syslog | grep anacron<br>
>May 2 19:35:52 trieli anacron[6305]: Job `cron.daily' terminated<br>
>May 2 19:35:52 trieli anacron[6305]: Normal exit (1 job run)<br>
>May 3 17:48:34 trieli systemd[1]: Started Trigger anacron at 19:30.<br>
><br>
>Above proves the run time for anacron has been amended, but why only one<br>
>job run? I've got lots of jobs in there:<br>
>daryl@trieli:~$ ls -al /etc/cron.daily<br>
>total 84<br>
>drwxr-xr-x 2 root root 4096 Apr 25 22:45 .<br>
>drwxr-xr-x 132 root root 12288 Apr 29 11:55 ..<br>
>-rwxr-xr-x 1 root root 311 May 29 2017 0anacron<br>
>-rwxr-xr-x 1 root root 376 Nov 20 2017 apport<br>
>-rwxr-xr-x 1 root root 1478 Apr 20 2018 apt-compat<br>
>-rwxr-xr-x 1 root root 355 Dec 29 2017 bsdmainutils<br>
>-rwxr-xr-x 1 root root 384 Dec 12 2012 cracklib-runtime<br>
>-rwxr-xr-x 1 root root 1176 Nov 2 2017 dpkg<br>
>-rwxr-xr-x 1 root root 372 Aug 21 2017 logrotate<br>
>-rwxr-xr-x 1 root root 1065 Apr 7 2018 man-db<br>
>-rwxr-xr-x 1 root root 538 Mar 1 2018 mlocate<br>
>-rwxr-xr-x 1 root root 449 Apr 14 2018 mythtv-database<br>
>-rwxr-xr-x 1 root root 1387 Dec 13 2017 ntp<br>
>-rwxr-xr-x 1 root root 1286 Jan 12 09:56 <a href="http://optimize_mythdb.pl" rel="noreferrer" target="_blank">optimize_mythdb.pl</a><br>
>-rwxr-xr-x 1 root root 249 Jan 25 2018 passwd<br>
>-rw-r--r-- 1 root root 102 Nov 16 2017 .placeholder<br>
>-rwxr-xr-x 1 root root 3477 Feb 20 2018 popularity-contest<br>
>-rwxr-xr-x 1 root root 246 Mar 21 2018 ubuntu-advantage-tools<br>
>-rwxr-xr-x 1 root root 214 Jul 12 2013 update-notifier-common<br>
><br>
>Is this as it should be?<br>
<br>
Yes.<br>
<br>
Anacron runs things from /etc/anacrontab. This is what is in<br>
anacrontab:<br>
<br>
root@mypvr:/etc# cat /etc/anacrontab<br>
# /etc/anacrontab: configuration file for anacron<br>
<br>
# See anacron(8) and anacrontab(5) for details.<br>
<br>
SHELL=/bin/sh<br>
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br>
HOME=/root<br>
LOGNAME=root<br>
<br>
# These replace cron's entries<br>
1 5 cron.daily run-parts --report /etc/cron.daily<br>
7 10 cron.weekly run-parts --report /etc/cron.weekly<br>
@monthly 15 cron.monthly run-parts --report<br>
/etc/cron.monthly<br>
<br>
So the job that anacron runs is named "cron.daily". The cron.daily<br>
job runs the command "run-parts --report /etc/cron.daily". So it runs<br>
the "run-parts" program on the contents of the "/etc/cron.daily"<br>
directory. If you do a "man run-parts" command, you will see that<br>
run-parts will read all the files in /etc/cron.daily and run them in<br>
the order it reads them. It will do it sequentially - one job will<br>
not start until the previous one has finished. The "--report" option<br>
makes run-parts output the name of any job it runs that produces<br>
output on stdout or stderr. Anacron collects all the output from<br>
run-parts and emails it to the user that anacron is running as (root<br>
in this case). If you do not have your system set up to do email,<br>
that email will be dropped. So you either need to install email<br>
software on your system, or put a "MAILTO=myemail@myaddress" line at<br>
the top of the /etc/anacrontab file to direct the email to one of your<br>
existing accounts.</blockquote><div><br></div><div>I've just implemented this part of your suggestion, thanks Stephan. </div><div>so the email will come after 19:30 when anacron runs? everyday? </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
</blockquote></div></div>