Remove backups when server is deleted #27

Closed
opened 2026-02-04 16:29:15 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @Boy132 on GitHub (Apr 23, 2024).

Originally assigned to: @iamkubi on GitHub.

ref https://github.com/pterodactyl/panel/issues/2564

Wings should remove all server backups when the server is deleted. Currently they are only deleted from the panel database but the actual backup files remain.

Originally created by @Boy132 on GitHub (Apr 23, 2024). Originally assigned to: @iamkubi on GitHub. ref https://github.com/pterodactyl/panel/issues/2564 Wings should remove all server backups when the server is deleted. Currently they are only deleted from the panel database but the actual backup files remain.
Author
Owner

@Mutex21 commented on GitHub (Apr 23, 2024):

I have also observed that, even if the server is deleted, backups are still present in backup pre-set location (for me it's /var/lib/pterodactyl/backups).

@Mutex21 commented on GitHub (Apr 23, 2024): I have also observed that, even if the server is deleted, backups are still present in backup pre-set location (for me it's /var/lib/pterodactyl/backups).
Author
Owner

@Boy132 commented on GitHub (Apr 23, 2024):

I have also observed that, even if the server is deleted, backups are still present in backup pre-set location (for me it's /var/lib/pterodactyl/backups).

Yes, that's exactly what this issue is about.
The server backups are deleted from the panel database but the actual backup files are not deleted.

@Boy132 commented on GitHub (Apr 23, 2024): > I have also observed that, even if the server is deleted, backups are still present in backup pre-set location (for me it's /var/lib/pterodactyl/backups). Yes, that's exactly what this issue is about. The server backups are deleted from the panel database but the actual backup files are not deleted.
Author
Owner

@lancepioch commented on GitHub (Apr 26, 2024):

When a server is being deleted, if it has backups at all, I feel like we should just ask if they want them deleted or not.

@lancepioch commented on GitHub (Apr 26, 2024): When a server is being deleted, if it has backups at all, I feel like we should just ask if they want them deleted or not.
Author
Owner

@iamkubi commented on GitHub (Apr 26, 2024):

When a server is being deleted, if it has backups at all, I feel like we should just ask if they want them deleted or not.

Seems reasonable. We'd also want to add a parameter to the delete server API call for non-interactive use.

Discussed this some and it seems like the easiest way to implement this will be in wings. As a bonus the plan is to put backups in per-server directories for easier identification. This will make it easier for admins that elect not to delete backups when the server is deleted to clean them up later.

@iamkubi commented on GitHub (Apr 26, 2024): > When a server is being deleted, if it has backups at all, I feel like we should just ask if they want them deleted or not. Seems reasonable. We'd also want to add a parameter to the delete server API call for non-interactive use. Discussed this some and it seems like the easiest way to implement this will be in wings. As a bonus the plan is to put backups in per-server directories for easier identification. This will make it easier for admins that elect not to delete backups when the server is deleted to clean them up later.
Author
Owner

@MennoGamed commented on GitHub (Apr 29, 2024):

When a server is being deleted, if it has backups at all, I feel like we should just ask if they want them deleted or not.

I don't know if this is useful, especially with automated systems like WHMCS. In any case, there should be an option in the panel to choose whether you want to give these choices or not. Otherwise, WHMCS can delete a server nicely, but you will be permanently stuck with backup files.

@MennoGamed commented on GitHub (Apr 29, 2024): > When a server is being deleted, if it has backups at all, I feel like we should just ask if they want them deleted or not. I don't know if this is useful, especially with automated systems like WHMCS. In any case, there should be an option in the panel to choose whether you want to give these choices or not. Otherwise, WHMCS can delete a server nicely, but you will be permanently stuck with backup files.
Author
Owner

@iamkubi commented on GitHub (May 9, 2024):

I have this mostly working but still need to test the s3 implementation. My plan for now is to add a wings config setting which defaults to enabled that deletes all backups for a server when that server is deleted. Admins who do not want this behavior will be able to disable it on a per-node basis and implement their own cleanup.

@iamkubi commented on GitHub (May 9, 2024): I have this mostly working but still need to test the s3 implementation. My plan for now is to add a wings config setting which defaults to enabled that deletes all backups for a server when that server is deleted. Admins who do not want this behavior will be able to disable it on a per-node basis and implement their own cleanup.
Author
Owner

@Technoguyfication commented on GitHub (Feb 5, 2025):

Is deleting backups from S3 storage implemented yet? If not, I think this issue should be re-opened or another issue should be created to implement cleanup of S3 backups.

@Technoguyfication commented on GitHub (Feb 5, 2025): Is deleting backups from S3 storage implemented yet? If not, I think this issue should be re-opened or another issue should be created to implement cleanup of S3 backups.
Author
Owner

@filasik commented on GitHub (Feb 25, 2025):

Is deleting backups from S3 storage implemented yet? If not, I think this issue should be re-opened or another issue should be created to implement cleanup of S3 backups.

Agree with you. For new users It is not the wanted experience.

@filasik commented on GitHub (Feb 25, 2025): > Is deleting backups from S3 storage implemented yet? If not, I think this issue should be re-opened or another issue should be created to implement cleanup of S3 backups. Agree with you. For new users It is not the wanted experience.
Author
Owner

@rmartinoscar commented on GitHub (Feb 25, 2025):

It is already implemented
3d764a89f7/app/Services/Backups/DeleteBackupService.php (L70-L86)

@rmartinoscar commented on GitHub (Feb 25, 2025): It is already implemented https://github.com/pelican-dev/panel/blob/3d764a89f7e36c61814c43c1bb612e959f0efb48/app/Services/Backups/DeleteBackupService.php#L70-L86
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel#27