[IGN-5998] Scheduled Backup Retention Count doesn't differentiate gateways

We recently setup some Ignition servers to do scheduled backups to one central location. The change a while back to prefix backup names with Ignition gateway name is great, and we figured we could put them all in one folder. We used settings like this on each server, all pointing to the same folder:


We expected to get 7 backups retained per server. Instead, we get the 7 latest backups between all servers retained:

This will be easily resolved by adding subfolders for each server, but isn’t the expected result when setting the retention count. It looks like a case of the back-end code being a little too simple in choosing what to delete from the target backup folder–code that probably made sense when backups did not have a gateway name prefixed to them.

Yikes, yeah, the backend code is very naive; it’s literally just preserving the latest X .gwbk files in the target directory (sorted by OS modification time). Bad idea. I’ve filed a ticket to fix that implementation. In the meantime, definitely go with subfolders.

3 Likes

Thanks @PGriffith. I’m glad to hear it does check for .gwbk extension :sweat_smile:

1 Like

This sounds exactly like my code for keeping the last X database backups lol. Don’t know whether to be proud or ashamed?

1 Like

Hey, in fairness, it’s served us unchanged for at least twelve years now (our Git history only goes back to 2011, it could be even older that that), so clearly it’s not a probably many people run into :partly_sunny:

2 Likes

Proud it is!

Yeah, this logic would’ve made sense when all gateway backups looked the same (no gateway name prefix).

For posterity: We’ve decided not to touch this, given that the workaround is so trivial to implement: just use subfolders.

1 Like