2025-04-23 16:24:22 +01:00
2025-04-23 16:11:22 +01:00
2025-04-23 16:24:22 +01:00

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

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

# 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:

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.

Description
No description provided
Readme 47 KiB
Languages
Python 86.8%
Shell 13.2%