Periodically clean up the automatic backups of the system configuration database

wyang

Dabbler
Joined
Jul 8, 2020
Messages
24
I just deployed TrueNAS-12.0-U3.1 on a bare metal server and would like to run script to back up system configs to a remote server.

According to doc, TrueNAS automatically backs up the configuration database to the system dataset every morning at 3:45.

I was wondering if TrueNAS Core also automatically cleans up the outdated backups of the configuration database.
If yes, is the retention period configurable?

Or I need to create scripts + cron job to clean them up?

Thanks very much!
 
Joined
Jan 4, 2014
Messages
1,644
I was wondering if TrueNAS Core also automatically cleans up the outdated backups of the configuration database.
If yes, is the retention period configurable?
I wouldn't pin my hopes completely on the automatic backup. What happens if you lose the pool that contains the system dataset? I prefer to think of this automatic backup as 'The Alamo'. @Chris Moore has assembled a resource Links to useful threads. If you have to rely on The Alamo, his resource includes a reference Where is the backup config db: to a post that will help you find your way around. It should also reveal the answer to the question you've asked.

Have a look at @Spearfoot's resource Github repository for FreeNAS scripts, including disk burnin and rsync support. It includes a couple of useful scripts for backing up the config db.

Up till recently, I've been using edgarsuit/FreeNAS report for reporting and config db backup. Unfortunately, the latter appears to be broken under TrueNAS 12. I've logged it as an issue, but so far there hasn't been any movement on it. It's a resource that doesn't appear to be regularly maintained. I still use this resource for reporting, but as I have TrueCommand already set up, I now rely on that for automatic config backup. It does a daily backup of the config db. Below is a sample screenshot.

tc75.jpg


One other source of config db backups is previous boot environments. The config db appears to included with these. It's another Alamo though.
 
Last edited:

wyang

Dabbler
Joined
Jul 8, 2020
Messages
24
Thanks so much @Basil Hendroff for the details and reference links.

I was thinking of using scripts and cron jobs. Your recommendation of TrueCommand opens a new door.
 
Top