Panel: Backup rotation if limit is reached

Created on 17 Oct 2020  路  5Comments  路  Source: pterodactyl/panel

Is your feature request related to a problem? Please describe.
When you hit the backup limit, the scheduled backup will fail

Describe the solution you'd like
Make a way to overwrite the oldest backup instead to fail the backup

Describe alternatives you've considered
none

Additional context
none

enhancement feature request

Most helpful comment

Another thing that would be nice to have is the ability to delete backups with a task. And the ability to delete multiple backups at a time.

All 5 comments

This would be a great feature!

Another thing that would be nice to have is the ability to delete backups with a task. And the ability to delete multiple backups at a time.

Both of these are much needed features. Especially when a coupe of days ago, Paper released an update which started deleting chunks! Backups are of upmost importance.

I looked into implementing this since I needed it myself.

The easiest way would be to make the rotation non-configurable, but some people may want to disable it.

I think the best way would be to have a "Backup Rotation" checkbox on the Create Task page. The problem with this is that a task can only have a single payload, which is currently used for ignored files on the "Create backup" task. So we would need some changes to allow multiple payloads per task, or we could encode both ignored files and backup rotation into the payload using JSON, or we could get rid of the "ignored files" payload, since it's configurable in the .pteroignore file anyway.

Another option would be a per-server setting to enable/disable backup rotations. It could be user-configurable like the server name is currently. However, I'm not sure if this should be in the "Backups" tab or in the "Settings" tab in the server view.

A third option would be to add a separate task that deletes the oldest backup if the backups are full. This would be relatively easy to implement and wouldn't require changes in task payload handling. It could be called something like "Rotate backups". The payload could be left unused, or it could be used for the number of how many backups to make room for, but I'm not sure if anyone would find that useful.

The above issue that this issue was mentioned in was mine, and I closed it, because while it's not quite a duplicate, it's close enough that I should present it here as an alternative solution. It might be harder to implement, but I believe that it would be more flexible:

Describe the solution you'd like
Ideally, I would like to be able to configure my schedule(s) to overwrite backups that they have created previously, perhaps with a simple toggle. I would imagine this could be done by parsing the names of all backups with the format already used by scheduled backups, and removing the newest backup whose date and time is reasonably close to the schedule's last run date and time.

Describe alternatives you've considered
Either alternatively or in addition to the above, backup deletion could be added either as a new type of task or as an option in the backup task. Ideally, this would delete one backup, all backups, or a user-specified number of backups, with names matching a format string provided by the user as an option in the delete backup task. For this to work well, I would also request the option to specify the backup name format in the create backup task.

Was this page helpful?
0 / 5 - 0 ratings