hbackup
hbackup is a simple, high-performance, cross-platform backup tool written in Rust. It is designed to be fast, efficient, and easy to use, with a focus on performance, reliability, and flexible backup management.
Features
- 🚀 Fast and simple file/directory backup via CLI
- 🖥️ Cross-platform: macOS, Linux, Windows
- 🗂️ Custom backup jobs with unique IDs
- 📝 Configuration and task management via TOML in user config directory
- 🏠 Supports
~,$HOME, and relative paths for source and target - 🔄 Edit, delete, and list backup jobs easily
- 🗜️ Compression support:
gzip,zip,sevenz,zstd,bzip2,xzandlz4for files and directories - 🛠️ Config file backup, reset, and rollback
- 📦 One-time backup: run a backup without saving a job
- 🧩 Extensible: easy to add new features
Quick Start
1. Install
2. Add one or more jobs
# Add a job with compression (gzip or zip)
3. List all jobs
4. Run backup jobs
-
Run all jobs:
-
Run a job by ID:
-
Run a one-time backup (without saving as a job):
You can also specify compression for a one-time backup:
5. Delete jobs
-
Delete a job by ID:
-
Delete all jobs:
6. Edit a job
Update the source and/or target of a job by its ID:
7. Manage configuration file
-
Show configuration file path:
-
Backup configuration file:
-
Reset configuration file (auto-backup before reset):
-
Rollback to the last backed up configuration file:
Compression Support
You can specify compression format (gzip, zip, sevenz, zstd, bzip2 or lz4) when adding or running jobs:
# Add a job with gzip compression
# or a short command line
# One-time backup with compression
- Compression works for both files and directories.
- Output files will have
gz,zip,7z,zst,bzip2,xzorlz4extensions. - If no compression is specified, files are copied as-is.
Command Reference
| Command | Description |
|---|---|
bk add |
Add a new backup job |
bk list |
List all backup jobs |
bk run |
Run all jobs, a job by ID, or a one-time backup |
bk delete |
Delete a job by ID or delete all jobs |
bk edit |
Edit a job's source/target by ID |
bk config |
Show, backup, reset, or rollback config file |
Run bk <command> --help for detailed options.
Configuration File Location
- macOS/Linux:
~/.config/hbackup/config.toml - Windows:
C:\Users\<User>\AppData\Roaming\hbackup\config.toml
A backup of the config file is automatically created before resetting.
Error Handling
- All errors are reported with clear messages.
- If you run
bkwithout a command, you'll see:
License
MIT