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

**URL:** <https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 3, 2022, 5:38pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169 "2022-05-03T17:38:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 3, 2022, 5:38pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/1 "2022-05-03T17:38:41Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c1ddceab709e6b64b9c9cdbf2e089853f734f378.png)  
We expected to get 7 backups retained per server. Instead, we get the 7 latest backups between all servers retained:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/b/9b24c6647178a93e5b3bf0ab9d5d180847ca04ac.jpeg)  
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.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 3, 2022, 5:54pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/2 "2022-05-03T17:54:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 3, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/3 "2022-05-03T18:04:45Z")

</div>

Thanks @paul-griffith. I’m glad to hear it does check for .gwbk extension 😅

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [May 3, 2022, 6:07pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/4 "2022-05-03T18:07:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 3, 2022, 6:10pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/5 "2022-05-03T18:10:41Z")

</div>

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 ⛅

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [May 3, 2022, 6:10pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/6 "2022-05-03T18:10:59Z")

</div>

Proud it is!

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 3, 2022, 6:14pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/7 "2022-05-03T18:14:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 13, 2022, 8:51pm UTC](https://forum.inductiveautomation.com/t/ign-5998-scheduled-backup-retention-count-doesnt-differentiate-gateways/59169/8 "2022-05-13T20:51:57Z")

</div>

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