Solved /var/backups is empty on one machine and abandoned on another

obsigna

Profile disabled
A power loss in the mid of pkg upgrading corrupted the package database /var/db/pkg/local.sqlite on one machine. No problem, there should be a recent backup in /var/backups, but that one was empty. Now, I deleted /var/db/pkg/local.sqlite and reinstalled all the packages from a list of packages which I want on that machine. That resolved the acute problem.

Anyway, why /var/backups was empty? I looked on my other machines (all FreeBSD 12.1-RELEASE), and most of it had /var/backups nicely populated with recent backups, for example:
Code:
# ls -l /var/backups/
total 16152
-rw-r--r--  1 root  wheel     1740 Nov  6 15:21 aliases.bak
-rw-r--r--  1 root  wheel     1740 Jan 14  2019 aliases.bak2
-rw-r--r--  1 root  wheel      968 Jan 22 20:23 group.bak
-rw-r--r--  1 root  wheel      947 Nov  6 15:21 group.bak2
-rw-------  1 root  wheel     3974 Nov  6 15:21 master.passwd.bak
-rw-------  1 root  wheel     3974 Jan  4  2019 master.passwd.bak2
-rw-r--r--  1 root  wheel  2002928 Apr 21 03:55 pkg.sql.xz
-rw-r--r--  1 root  wheel  2002952 Apr 20 03:36 pkg.sql.xz.1
-rw-r--r--  1 root  wheel  2002952 Apr 19 03:36 pkg.sql.xz.2
-rw-r--r--  1 root  wheel  2003060 Apr 18 03:36 pkg.sql.xz.3
-rw-r--r--  1 root  wheel  2002472 Apr 17 03:36 pkg.sql.xz.4
-rw-r--r--  1 root  wheel  2002472 Apr 16 04:15 pkg.sql.xz.5
-rw-r--r--  1 root  wheel  2002472 Apr 15 03:36 pkg.sql.xz.6
-rw-r--r--  1 root  wheel  2002472 Apr 14 03:36 pkg.sql.xz.7

Just one other machine seem to have abandoned the backups at the end of the last year.

I cannot remember, that I did anything special for enabling or disabling backups on any of the machines, these kind of settings are supposed to be identical, and of course I would like to have a healthy set of backups in the said directory on every system.

Anyone got any ideas what is going on here?
 
Looking at the time of the pkg backup files, I now see that these are perhaps generated by the daily cron job. All machines with a good backup history are 24/7 ones. The desktop system, which are turned off over night, either don’t have pkg backup files or only a quite old one. So I guess, I want to run the pkg backup job on starting-up. The whole daily job takes too long. I am going to break it down now.
 
grep -r /var/backups /usr/local/etc shows the scripts that get executed by cron. Most probably the daily run does not get executed.
 
By default the daily run is scheduled for 3am in the morning. If this is a laptop that's powered off at night then it won't happen. For this reason I changed the time on my laptop to 8pm instead. The file that is configured in is /etc/crontab.
 
Back
Top