What is the best way to backup an application's files on a daily basis?

EMBoots

Dabbler
Joined
Jun 26, 2020
Messages
27
Hey y'all I have some applications running on my TrueNAS Scale install that I would want to have backed up monthly or weekly and I was wondering if there's a way to just set up a local backup on the NAS.
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
That depends on the applications. The reason is that often an application saves data (aka state) in multiple files. So a single data change transaction affects more than one file. The classical example here is a database server. So you need to ensure that both files (e.g. the actual data and the index file) are backed up at exactly the same point in time. Point in time means that no changes can be done during the backup. So we are not talking about a precision of seconds, milliseconds, or microseconds. We are talking about an absolute(!) guarantee that no transactions happen. For database servers there is specialized software (often as an add-on to the actual backup software) that takes care of this. For other systems, a custom-made solution is needed.

If this aspect is ignored, a backup will still work in most cases. But after a restore the data will be inconsistent. The latter will either prevent the application from starting up again (if you are lucky), or have the system run with wrong/inconsistent data. In other words: the restore is always the more delicate side than the backup. Without a well-tested (on a regular basis) restore, a backup is a bit like Russian roulette. It may work, but you don't know, until you really need it. Not a position to be in.

The other aspect that will affect the approach, is what your requirements are in terms of retention tine, data volume, etc. I recommend to search for this kind of general information. There is a ton of really good information out there.

Last but not least, you need a backup that is not stored on your NAS in addition.
 
Top