Simple-Backup
A lightweight, configurable backup tool for creating local archives of your important files. This tool creates compressed backups on your local filesystem that can be easily transferred to external storage or cloud services.
Overview
Simple-Backup provides:
- Configurable backup sources and destinations
- Support for both TAR (high compression) and ZIP (faster) archive formats
- Pattern-based file exclusion
- Cross-platform compatibility on Linux systems
Installation
You can install Simple-Backup system-wide to run it from anywhere:
# Clone the repository
git clone https://github.com/yourusername/simple-backup.git
cd simple-backup
# Run the setup script
./setup.sh
The setup script will either:
- Create a symlink in
/usr/local/binif you have write permissions - Prompt you to run with sudo if needed
- Offer to add the directory to your PATH in ~/.bashrc
After installation, you can run the backup command from any directory.
Configuration
Create new backup jobs by adding JSON configuration files to the configs/ directory. Each configuration file should include:
| Field | Description |
|---|---|
outputDir |
Directory where backups will be saved (supports ~ for home directory) |
inputs |
List of directories/files to back up |
ignorePatterns |
List of patterns to exclude from backup |
archiveType |
Either "tar" (default, higher compression) or "zip" (faster, better compatibility) |
Example configuration:
{
"outputDir": "~/backups/",
"inputs": [
"~/Documents/",
"~/Pictures/"
],
"ignorePatterns": [
".git/",
"node_modules/"
],
"archiveType": "zip"
}
Running
You can run backups manually or as a scheduled task:
Manual Execution
# Once installed, simply run:
backup
# Or from the repository directory:
./backup.py
Scheduled Execution (Linux)
Add a cron job to run backups automatically, for example weekly on Saturday at 1:05 AM:
sudo crontab -e
# Add this line:
5 1 * * 6 /path/to/simple-backup/backup.py >> /var/log/simple-backup.log 2>&1
Exclude Patterns
The exclusion system uses simple string matching:
- Patterns are matched against the full file path
- No regex or glob syntax is supported
- For directories, adding a trailing slash (e.g.,
.git/) will exclude the directory and all its contents
What's Next?
After creating backups, you'll need to manually copy them to external storage or cloud services like Proton Drive, Google Drive, or Dropbox for off-site backup.