Safetar is a high-performance Bash utility for creating compressed archives with built-in integrity verification. It leverages parallel compression and provides multiple verification modes to ensure data integrity.
- 🚀 Fast Parallel Compression: Uses
pigzfor multi-threaded gzip compression - 📊 Real-time Progress: Visual progress bars for compression and verification
- ✅ Integrity Verification: Two verification modes:
- Quick Check: Fast gzip test for basic validation
- Paranoid Mode: Byte-by-byte diff comparison for maximum safety
- 🎨 Beautiful CLI: Colored output with ASCII art and formatted boxes
- 🔄 Smart Overwrite Protection: Prompts before overwriting existing archives
- 🖥️ Cross-Platform: Works on macOS and Linux
The following dependencies are required:
pigz- Parallel implementation of gzippv- Pipe Viewer for progress monitoringgtar- GNU tar (on macOS, BSD tar on Linux)
- Clone the repository:
git clone <repository-url>
cd Safetar- Make the script executable:
chmod +x src/safetar- Optionally, symlink to your PATH:
ln -s "$(pwd)/src/safetar" /usr/local/bin/safetar- Install dependencies (macOS):
brew install pigz pv gnu-tarsafetar <folder> [options]| Option | Description |
|---|---|
-c, --check |
Perform quick integrity check after compression |
-p, --paranoid |
Perform thorough byte-by-byte verification |
-f, --force |
Overwrite existing archive without prompt |
-h, --help |
Display help message |
Standard compression:
safetar my-folderWith quick integrity check:
safetar my-folder --checkWith paranoid verification:
safetar my-folder --paranoidForce overwrite:
safetar my-folder --forceCreates a compressed .tar.gz archive without verification. Fast and suitable when integrity checking is not critical.
After compression, performs a gzip test to verify the archive can be decompressed. Quick validation of archive integrity.
Performs a complete byte-by-byte comparison between the source folder and the decompressed archive content. Ensures absolute data integrity but takes longer.
- Source Analysis: Calculates folder size for progress tracking
- Compression: Uses
tar+pigz -9for maximum compression with parallel processing - Progress Display: Real-time progress bar shows compression status
- Verification (optional): Tests archive integrity based on selected mode
- Result: Outputs
.tar.gzfile in current directory
┌────────────────────────────────────┐
│ SAFETAR Secure Archiver │
├────────────────────────────────────┤
│ Output : my-folder.tar.gz │
│ Mode : Paranoid (Diff) │
└────────────────────────────────────┘
Compressing : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
Verifying : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
✔ Archive created successfully.
Safetar uses parallel compression via pigz, which can significantly speed up compression on multi-core systems. The number of threads is automatically detected based on your CPU.
- Archives are created in the current working directory
- The script automatically handles macOS (uses
gtar) and Linux (usestar) - Progress updates occur every 0.1 seconds for smooth display
- Paranoid mode requires more time but guarantees data integrity
- Version: 1.0.0
- Author: Quentin Lamamy
- Date: 2026-01-06
- Language: Bash
- Compression: tar + pigz (gzip level 9)
See LICENSE file for details.
Contributions are welcome! Feel free to open issues or submit pull requests.
