More human readable readme
This commit is contained in:
83
README.md
83
README.md
@@ -1,25 +1,74 @@
|
|||||||
# simple-backup
|
# Simple-Backup
|
||||||
This creates a backup on the local filesystem, but does not persist it anywhere else. Right now
|
|
||||||
the best solution i have to to manually upload this to proton drive.
|
|
||||||
|
|
||||||
## configure
|
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.
|
||||||
Can add new backups to this by adding another conf file. See configs directory for examples.
|
|
||||||
|
|
||||||
Each config file should include:
|
## Overview
|
||||||
- `outputDir`: Where to store the backup
|
|
||||||
- `inputs`: List of directories/files to back up
|
|
||||||
- `ignorePatterns`: List of patterns to exclude
|
|
||||||
- `archiveType`: Either "tar" (default) or "zip" (faster, lower compression)
|
|
||||||
|
|
||||||
## running
|
Simple-Backup provides:
|
||||||
Can run with ./backup.py, or create a cron job.
|
- Configurable backup sources and destinations
|
||||||
Current crontab entry is (every sat at 0105):
|
- Support for both TAR (high compression) and ZIP (faster) archive formats
|
||||||
|
- Pattern-based file exclusion
|
||||||
|
- Cross-platform compatibility on Linux systems
|
||||||
|
|
||||||
|
## 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:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"outputDir": "~/backups/",
|
||||||
|
"inputs": [
|
||||||
|
"~/Documents/",
|
||||||
|
"~/Pictures/"
|
||||||
|
],
|
||||||
|
"ignorePatterns": [
|
||||||
|
".git/",
|
||||||
|
"node_modules/"
|
||||||
|
],
|
||||||
|
"archiveType": "zip"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Running
|
||||||
|
|
||||||
|
You can run backups manually or as a scheduled task:
|
||||||
|
|
||||||
|
### Manual Execution
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Make the script executable if needed
|
||||||
|
chmod +x backup.py
|
||||||
|
|
||||||
|
# Run the backup
|
||||||
|
./backup.py
|
||||||
|
```
|
||||||
|
|
||||||
|
### Scheduled Execution (Linux)
|
||||||
|
|
||||||
|
Add a cron job to run backups automatically, for example weekly on Saturday at 1:05 AM:
|
||||||
|
|
||||||
|
```bash
|
||||||
sudo crontab -e
|
sudo crontab -e
|
||||||
5 1 * * 6 /home/craig/services/simple-backup/backup.py >> /var/log/simple-backup.log 2>&1
|
# Add this line:
|
||||||
|
5 1 * * 6 /path/to/simple-backup/backup.py >> /var/log/simple-backup.log 2>&1
|
||||||
```
|
```
|
||||||
|
|
||||||
## exlude patterns
|
## Exclude Patterns
|
||||||
Uses simple "filter" in "path", so no globbing/regexing.
|
|
||||||
|
|
||||||
For directories, having a trailing slash means it includes the dir but none of its contents.
|
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.
|
||||||
Reference in New Issue
Block a user