7 Tools for Compressing and Tiering Old Logs
Seven tools for compressing and tiering old logs, from rclone and restic to logrotate and zstd.
On this page
Key takeaways
- Compression shrinks old logs so retention costs less.
- Tiering moves logs to cheaper storage as they age.
- Rotation, compression, and tiering work as one pipeline.
- The goal is keeping history affordable without losing it.
Quick comparison
| Tool | Best for | Starting price | Free plan |
|---|---|---|---|
| rclone | Moving logs to object storage | Not included | Not included |
| restic | Encrypted log backups | Not included | Not included |
| borgbackup | Deduplicated log archives | Not included | Not included |
| logrotate | Rotating and compressing | Not included | Not included |
| zstd | Fast log compression | Not included | Not included |
| rsyslog | Syslog collection and routing | Not included | Not included |
| 7-Zip | High-ratio compression | Not included | Not included |
The best tools for compressing and tiering old logs
1. rclone
- Official site: https://rclone.org/
- Best for: Moving logs to object storage
- Starting price: Not included
- Free plan: Not included
- Pros: Many backends; sync
- Cons: Command-line tool
rclone copies and syncs files to object storage and many other backends, which makes it a common way to tier old logs off the server. A team can move compressed archives to a cheaper bucket on a schedule. The sync keeps the destination current.
The tiering step is where retention cost is won, since object storage is far cheaper than live disks for old data. rclone makes that move a single command that fits into a scheduled job.
2. restic
- Official site: https://restic.net/
- Best for: Encrypted log backups
- Starting price: Not included
- Free plan: Not included
- Pros: Encryption; deduplication
- Cons: Backup focused
restic backs up files with encryption and deduplication, which suits log archives that must be kept securely for compliance. The deduplication means repeated content does not repeat in storage. Backups can go to many storage backends.
For old logs, restic turns the archive into a protected, space-efficient copy. The encryption matters when the logs contain sensitive data that must stay private even in a shared bucket.
3. borgbackup
- Official site: https://borgbackup.readthedocs.io/
- Best for: Deduplicated log archives
- Starting price: Not included
- Free plan: Not included
- Pros: Strong dedup; compression
- Cons: Backup focused
borgbackup creates deduplicated, compressed archives, which is useful when many log files share similar content. The space savings come from storing shared chunks once. It is a well-tested tool for long-term retention.
For logs that are mostly similar lines with small changes, deduplication can shrink storage dramatically. borgbackup also compresses, so the archive is both smaller and still restorable. The restore path is a single command, which keeps the archive practical when an old log is needed.
4. logrotate
- Official site: https://github.com/logrotate/logrotate
- Best for: Rotating and compressing
- Starting price: Not included
- Free plan: Not included
- Pros: Standard; automatic
- Cons: Config per file
logrotate rotates log files on a schedule and can compress the rotated copies, which is the first step of a tiering pipeline. Its rules set how many copies to keep and when to compress or remove them. Most Linux systems already run it.
The compression at rotation time is what keeps live disks from filling with old text. logrotate hands the compressed files to the next stage, where tiering moves them off the host.
5. zstd
- Official site: https://facebook.github.io/zstd/
- Best for: Fast log compression
- Starting price: Not included
- Free plan: Not included
- Pros: Fast; good ratio
- Cons: Library and CLI
zstd compresses data quickly with a strong ratio, which suits log files that are both large and repetitive. It is available as a command-line tool and a library. The speed means compression does not become a bottleneck in the pipeline.
For logs, the combination of speed and ratio is the appeal. zstd shrinks files enough to matter while staying fast enough to run on every rotation.
6. rsyslog
- Official site: https://www.rsyslog.com/
- Best for: Syslog collection and routing
- Starting price: Not included
- Free plan: Not included
- Pros: Ubiquitous; reliable
- Cons: Syslog-centric
rsyslog can write incoming logs to files and forward them onward, which places it at the start of a tiering pipeline. It can route different message types to different destinations. The filtering happens before storage.
For logs that arrive over syslog, rsyslog is where the retention policy first takes effect. It decides what is kept, where it goes, and in what form, feeding the compression and tiering stages.
7. 7-Zip
- Official site: https://www.7-zip.org/
- Best for: High-ratio compression
- Starting price: Not included
- Free plan: Not included
- Pros: High ratio; broad formats
- Cons: Manual by default
7-Zip compresses files with a very high ratio, which is useful for archiving logs that must be kept but rarely read. It supports many formats and can be scripted. The tradeoff is that the highest ratio takes more time.
For cold archives that are kept for compliance rather than search, the extra compression is worth the slower run. 7-Zip turns a large log directory into a small archive that stores for years.
How we chose
We looked for tools that shrink old logs and move them to cheaper storage, since retention is only practical when the cost stays low. The list spans rotation, compression, and offloading tools so a team can assemble the full pipeline. Each entry handles one stage of the path from live log to cold archive.
We favored tools that can be scheduled, because a retention pipeline that needs a human to run it will be skipped. The whole point is that old logs are handled automatically as they age. A script that rotates, compresses, and tiers in one pass is the practical goal.
We also valued safety, since the archive must be restorable when a compliance or support question needs it. Deduplication and encryption protect the data, and the compression must not lose it. The best setup keeps history both cheap and recoverable.
FAQ
What is log tiering?
Tiering moves logs to cheaper storage as they age, such as from live disk to object storage. Recent logs stay fast to read, while old logs sit where cost is low. The move is usually automatic on a schedule.
When should I compress old logs?
As soon as they are no longer actively searched, which is usually at rotation time. Compression shrinks the files before they are moved off the host. The timing is part of the rotation policy.
Does compression affect how I search old logs?
Yes, compressed logs must be decompressed before a plain-text search. Some tools can read compressed formats directly, but the general rule is that search is slower on the archive. That is the accepted tradeoff of keeping it cheap.
How long should I keep old logs?
Long enough to answer the compliance and support questions that matter, and no longer. The window usually follows a policy or a support promise. Tiering and compression make a longer window affordable.
Can I tier logs to any cloud?
Most object storage and file services work with the tools here, so the destination is a choice, not a limit. Pick the store that matches your cost and access needs. The tools handle the transfer and the sync.
How do I automate the whole retention pipeline?
Chain the steps into a scheduled job that runs rotation, compression, and tiering in order. Each tool here does one stage, and the script connects them. Once the job runs unattended, retention stops being a manual chore.