Never lose your precious data again! π‘οΈ
An intelligent backup tool that makes data protection effortless with incremental backups, smart compression, and beautiful reporting.
- π Incremental Backups - Only backup what's changed, save time and space
- ποΈ Smart Compression - Different algorithms optimized for different file types
- π Beautiful Reports - Visual progress bars and detailed backup statistics
- β° Scheduling Support - Daily, weekly, or custom backup schedules
- π Encryption Options - Secure your sensitive data with AES encryption
- π― Conflict Resolution - Smart handling of file conflicts during restore
- π Cross-Platform - Works seamlessly on Linux, macOS, and Windows
- π¨ Rich CLI - Colored output with formatted tables and progress indicators
- π Virtual Environment - Clean, isolated installation
- β‘ Easy Alias - Simple
smart-backup
command after installation
# Clone the repository
git clone https://github.com/LinuxCTRL/smart-backup.git
cd smart-backup
# Install with virtual environment (recommended)
chmod +x install_venv.sh
./install_venv.sh
# Restart terminal or reload shell
source ~/.bashrc
# Create your first backup
smart-backup create /home/user/projects --destination /backup/projects
# Create compressed backup with encryption
smart-backup create /home/user/documents --destination /backup/docs --compress --encrypt
# List all backups
smart-backup list --show-sizes
# Restore from backup
smart-backup restore /backup/projects/2024-01-15_14-30-25 --target /home/user/projects_restored
# Show backup status and statistics
smart-backup status --chart
Command | Description | Example |
---|---|---|
create |
Create a new backup | smart-backup create /source --destination /backup |
restore |
Restore from backup | smart-backup restore /backup/snapshot --target /restore/path |
list |
List all backups | smart-backup list --show-sizes |
status |
Show backup status | smart-backup status --detailed |
Command | Description | Example |
---|---|---|
schedule |
Set up automatic backups | smart-backup schedule --daily --time 02:00 |
verify |
Verify backup integrity | smart-backup verify /backup/snapshot |
cleanup |
Remove old backups | smart-backup cleanup --keep-last 10 |
diff |
Compare backup with source | smart-backup diff /backup/snapshot /source |
# Basic backup
smart-backup create /home/user/projects --destination /backup
# Compressed backup (saves 60-80% space)
smart-backup create /home/user/projects --destination /backup --compress
# Encrypted backup for sensitive data
smart-backup create /home/user/documents --destination /backup --encrypt --password
# Incremental backup (only changed files)
smart-backup create /home/user/projects --destination /backup --incremental
# Exclude specific files/folders
smart-backup create /home/user/projects --destination /backup --exclude "*.tmp,node_modules,__pycache__"
# Custom compression level
smart-backup create /home/user/projects --destination /backup --compress --level 9
# Backup with custom name
smart-backup create /home/user/projects --destination /backup --name "project_release_v1.0"
# Restore to original location
smart-backup restore /backup/projects/2024-01-15_14-30-25
# Restore to different location
smart-backup restore /backup/projects/2024-01-15_14-30-25 --target /home/user/restored_projects
# Restore with conflict resolution
smart-backup restore /backup/snapshot --target /restore/path --on-conflict ask
smart-backup restore /backup/snapshot --target /restore/path --on-conflict overwrite
smart-backup restore /backup/snapshot --target /restore/path --on-conflict skip
# Restore specific files only
smart-backup restore /backup/snapshot --target /restore/path --files "*.py,*.md"
# Dry run (preview what will be restored)
smart-backup restore /backup/snapshot --target /restore/path --dry-run
# Schedule daily backups at 2 AM
smart-backup schedule /home/user/projects --destination /backup --daily --time 02:00
# Schedule weekly backups on Sundays
smart-backup schedule /home/user/projects --destination /backup --weekly --day sunday --time 03:00
# Custom schedule using cron syntax
smart-backup schedule /home/user/projects --destination /backup --cron "0 2 * * 1-5"
# List scheduled backups
smart-backup schedule --list
# Remove scheduled backup
smart-backup schedule --remove backup_job_1
π¦ Smart Backup Tool v1.0.0
π Analyzing source directory: /home/user/projects
π Found 1,247 files (2.3 GB)
ποΈ Compression: Enabled (Level 6)
π Encryption: Disabled
βββββββββββββββββββββββ¬ββββββββββββββββββ
β Metric β Value β
βββββββββββββββββββββββΌββββββββββββββββββ€
β Total Files β 1,247 β
β Total Size β 2.3 GB β
β Estimated Backup β 890 MB β
β Compression Ratio β 61% β
βββββββββββββββββββββββ΄ββββββββββββββββββ
π Starting backup...
ββββββββββββββββββββββββββββββββββββββββ 100% | 1247/1247 files | 2.3GB β 890MB
β
Backup completed successfully!
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β Backup Details β Value β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ€
β Backup ID β projects_2024-01-15_14-30-25 β
β Location β /backup/projects_2024-01-15... β
β Original Size β 2.3 GB β
β Backup Size β 890 MB β
β Compression β 61% reduction β
β Duration β 2m 34s β
β Files Processed β 1,247 β
β Files Skipped β 0 β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ
π‘ Tip: Use 'smart-backup list' to see all your backups
π¦ Available Backups
βββββββββββββββββββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Backup Name β Date β Size β Files β Type β
βββββββββββββββββββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β projects_2024-01-15_14-30 β 2024-01-15 β 890 MB β 1,247 β Compressed β
β projects_2024-01-14_14-30 β 2024-01-14 β 45 MB β 23 β Incremental β
β projects_2024-01-13_14-30 β 2024-01-13 β 885 MB β 1,224 β Compressed β
β documents_2024-01-15_09-15 β 2024-01-15 β 1.2 GB β 3,456 β Encrypted β
βββββββββββββββββββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
π Total: 4 backups | 3.1 GB storage used
πΎ Available space: 47.2 GB
Configuration is stored at ~/.config/smart-backup/config.json
:
{
"default_compression": true,
"compression_level": 6,
"default_encryption": false,
"backup_retention": 30,
"progress_bar": true,
"colored_output": true,
"default_exclude": ["*.tmp", "*.log", "__pycache__", "node_modules", ".git"],
"compression_algorithms": {
"text": "lzma",
"images": "zip",
"videos": "none",
"archives": "none"
}
}
- Python 3.7+
- Virtual environment (automatically created)
- Available disk space for backups
click>=8.0.0 # CLI interface
rich>=12.0.0 # Beautiful terminal output
cryptography>=3.4.0 # Encryption support
psutil>=5.8.0 # System information
tqdm>=4.62.0 # Progress bars
schedule>=1.1.0 # Task scheduling
- Backups: Stored in user-specified destination directories
- Config:
~/.config/smart-backup/config.json
- Logs:
~/.local/share/smart-backup/logs/
- Schedule:
~/.local/share/smart-backup/schedule.db
- AES-256 encryption for sensitive data
- Password-based or key-file authentication
- Secure key derivation using PBKDF2
- SHA-256 checksums for all backed up files
- Backup verification to ensure data integrity
- Corruption detection during restore operations
- Multi-threaded processing for large directories
- Smart file type detection for optimal compression
- Memory-efficient streaming for large files
- Delta compression for incremental backups
- Parallel compression on multi-core systems
- Large projects (10GB+): ~5-10 minutes with compression
- Incremental backups: ~30 seconds for typical changes
- Compression ratio: 60-80% for code projects
- Memory usage: <100MB for most operations
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run directly
python3 smart_backup.py --help
smart-backup/
βββ smart_backup.py # Main application
βββ install_venv.sh # Virtual environment installer
βββ run.sh # Runner script
βββ requirements.txt # Dependencies
βββ README.md # This file
βββ LICENSE # MIT License
βββ tests/ # Test suite
βββ test_backup.py
βββ test_restore.py
βββ test_compression.py
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Rich for beautiful terminal output
- Click for the excellent CLI framework
- Cryptography for secure encryption
- π Bug Reports: Open an issue
- π‘ Feature Requests: Start a discussion
- π§ Contact: sofalcons@outlook.com
β Star this repo if it saves your data!
Made with β€οΈ by LinuxCTRL - Controlling the world through better developer tools! ππͺ
Part of the LinuxCTRL Developer Toolkit - Building tools that developers actually want to use.