feat(volume-backups): add gzip compression to volume backups - #5206
Open
anxo-outeiral wants to merge 1 commit into
Open
feat(volume-backups): add gzip compression to volume backups#5206anxo-outeiral wants to merge 1 commit into
anxo-outeiral wants to merge 1 commit into
Conversation
Comment on lines
+159
to
+160
| // delete all the .tar.gz files | ||
| const command = `rm -rf ${volumeBackupPath}/*.tar.gz`; |
Contributor
There was a problem hiding this comment.
Legacy archives escape cleanup
If an interrupted pre-upgrade backup leaves a local .tar archive, the changed failure handler matches only .tar.gz, leaving the legacy archive on disk indefinitely and consuming server storage.
Knowledge Base Used: Backups and restore
Volume backups were creating uncompressed .tar archives using tar cvf. This changes to tar czf (gzip compression), producing .tar.gz files that are significantly smaller for compressible data (text, JSON, SQLite, logs), reducing S3 storage costs. Changes: - backup.ts: tar cvf -> tar czf, extension .tar -> .tar.gz - utils.ts: retention filter *.tar -> *.tar.gz, error cleanup updated Compatibility: - gzip is pre-installed in the ubuntu image used for volume backups - tar xvf in restore auto-detects gzip, so existing restore logic works for both old .tar and new .tar.gz files - Old .tar files in S3 are not affected by the new retention policy (which now filters *.tar.gz); they require manual cleanup Closes Dokploy#3566
anxo-outeiral
force-pushed
the
feat/volume-backup-gzip-compression
branch
from
August 28, 2026 16:23
d01baef to
76615ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
Volume backups currently create uncompressed
.tararchives usingtar cvf. This means that for data that compresses well (SQLite databases, JSON, text logs, configuration files), the backup stored in S3 is the same size as the original volume — wasting storage space and increasing S3 costs.This PR changes to
tar czf(gzip compression), producing.tar.gzfiles that are significantly smaller for compressible data, reducing S3 storage costs and transfer time.Changes
backup.ts: Changedtar cvf→tar czfand extension.tar→.tar.gzutils.ts: Updated retention filter--include "*.tar"→--include "*.tar.gz"and error cleanup*.tar→*.tar.gzCompatibility
ubuntuDocker image used for volume backups — no additional dependencies or runtime package installation neededtar xvfinrestore.tsauto-detects gzip compression, so existing restore logic continues to work for both old.tarand new.tar.gzfiles without any changes.tarfiles already in S3 are not affected by the new retention policy (which now filters*.tar.gz); they will need manual cleanupTesting
Tested locally with a full development stack (Dokploy dev server + MinIO as local S3 destination + Docker Swarm):
gzipis available in theubuntuDocker image.tar.gzfile appears in S3 destination (MinIO)filecommand reportsgzip compressed data, from Unix.tar.gzbackup successfullykeepLatestCountretention works with.tar.gzextensiontar xvfrestores both.tarand.tar.gzCompression results (13.4MB of text/JSON/SQL data):
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
Closes #3566
Screenshots (if applicable)
Backup log showing
tar czfand.tar.gz:Greptile Summary
This PR gzip-compresses newly created volume-backup archives and updates current-format retention and failure cleanup patterns.
.tarto.tar.gz.Confidence Score: 4/5
The PR appears safe to merge, with a non-blocking cleanup gap for local archives left by interrupted pre-upgrade backups.
Compression, listing, retention of new archives, and restore remain aligned, but the changed failure cleanup can leave legacy local
.tarartifacts consuming disk space.Files Needing Attention: packages/server/src/utils/volume-backups/utils.ts
Reviews (1): Last reviewed commit: "feat(volume-backups): add gzip compressi..." | Re-trigger Greptile
Context used: