{"id":27078751,"url":"https://github.com/universal-development/rearden-backup","last_synced_at":"2026-05-16T00:38:20.470Z","repository":{"id":286337258,"uuid":"961110739","full_name":"universal-development/rearden-backup","owner":"universal-development","description":"lightweight and reliable Bash script that automates the backup of local directories and securely uploads them to a remote storage service","archived":false,"fork":false,"pushed_at":"2025-04-19T12:00:46.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T18:45:51.744Z","etag":null,"topics":["bash","rclone","rsync"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/universal-development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-05T19:19:59.000Z","updated_at":"2025-04-13T08:36:09.000Z","dependencies_parsed_at":"2025-04-09T20:17:42.159Z","dependency_job_id":"2aeba835-6172-420b-90c1-2eca17476955","html_url":"https://github.com/universal-development/rearden-backup","commit_stats":null,"previous_names":["universal-development/rearden-backup"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/universal-development/rearden-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-development%2Frearden-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-development%2Frearden-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-development%2Frearden-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-development%2Frearden-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/universal-development","download_url":"https://codeload.github.com/universal-development/rearden-backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/universal-development%2Frearden-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273717846,"owners_count":25155482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","rclone","rsync"],"created_at":"2025-04-06T01:17:53.558Z","updated_at":"2026-05-16T00:38:20.461Z","avatar_url":"https://github.com/universal-development.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"### rearden-backup\n\nLightweight and reliable Bash script that automates the backup of local directories and securely\nuploads them to a remote storage service.\n\nThis tool combines the power of `restic` for secure, incremental local backups with `rclone` for seamless remote syncing across\ncloud providers, SFTP, WebDAV, or even custom remote endpoints.\n\n#### 🔧 Features\n\n- 📁 Backup selected local directories with `restic`\n- ☁️ Upload backups to remote storage using `rclone`\n- 🔒 Strong encryption with `restic` for secure backups\n- 🔄 Easy restoration from any snapshot\n- 📊 Backup statistics and verification\n- 🕒 Supports scheduled (cron) execution for automated daily backups\n- 📋 Comprehensive logging system with log rotation\n- 🔃 Profile support for multiple backup configurations\n- 🚫 Lock mechanism to prevent concurrent executions\n- 🧪 Dry-run capability to preview actions\n- 🧰 Minimal dependencies: only `bash`, `restic`, and `rclone`\n\n#### 💼 Use Cases\n\n- Personal or professional workstation backups\n- Offsite backups for servers or VPS\n- Archiving dev environments, config files, or databases\n- Multi-system backup management with profiles\n\n#### Installation\n\n1. Check out rearden-backup into any path (here is `${HOME}/.rearden-backup`)\n\n   ```bash\n   git clone git@github.com:universal-development/rearden-backup.git ~/.rearden-backup\n   ```\n\n2. Add `~/.rearden-backup/bin` to your `$PATH` any way you like\n\n   ```bash\n   echo 'export PATH=\"$HOME/.rearden-backup/bin:$PATH\"' \u003e\u003e ~/.bash_profile\n   ```\n\n#### Commands\n\n| Command                     | Description                                                  |\n|-----------------------------|--------------------------------------------------------------|\n| `init`                      | Initialize the restic repository                             |\n| `backup`                    | Create a new backup                                          |\n| `restore [path] [snapshot]` | Restore from backup (defaults to latest snapshot and / path) |\n| `push`                      | Upload entire CONFIG_DIR to remote storage                   |\n| `pull`                      | Download entire CONFIG_DIR from remote storage               |\n| `list`                      | List available snapshots                                     |\n| `stats`                     | Show backup statistics                                       |\n| `verify`                    | Verify the integrity of the backup repository                |\n| `export`                    | Export backup information to a file                          |\n| `template`                  | Display a template for init.sh file                          |\n\n#### Options\n\n| Option                  | Description                                       |\n|-------------------------|---------------------------------------------------|\n| `-p, --profile PROFILE` | Use specific profile configuration                |\n| `-d, --dry-run`         | Show what would be done without actually doing it |\n| `-v, --verbose`         | Enable basic verbosity (level 1)                  |\n| `-vv`                   | Enable more detailed verbosity (level 2)          |\n| `-vvv`                  | Enable maximum verbosity (level 3)                |\n| `-h, --help`            | Show help message                                 |\n\n#### Environment Variables\n\n| Variable            | Description                                                        | Default   |\n|---------------------|--------------------------------------------------------------------|-----------|\n| `INIT_SCRIPT`       | Path to initialization script                                      | `init.sh` |\n| `PROFILE`           | Default profile name                                               | `default` |\n| `DRY_RUN`           | Set to 1 for dry-run mode                                          | `0`       |\n| `VERBOSE`           | Set verbosity level: 0=none, 1=basic, 2=detailed, 3=maximum        | `1`       |\n| `MAX_LOG_FILES`     | Maximum number of log files to keep                                | `10`      |\n| `RESTIC_REPOSITORY` | Optional: Use a remote repository directly instead of local+rclone | ` `       |\n\n#### Configuration Variables (in init.sh)\n\n| Variable               | Description                                                                    | Required        |\n|------------------------|--------------------------------------------------------------------------------|-----------------|\n| `CONFIG_DIR`           | Directory for all configuration and backup files                               | Yes             |\n| `BACKUP_DIRECTORIES`   | Space-separated list of directories to backup                                  | Yes             |\n| `LOCAL_BACKUP_REPO`    | Local repository path for restic (default: `${CONFIG_DIR}/backups/${PROFILE}`) | No              |\n| `RCLONE_REMOTE`        | Remote storage path for rclone                                                 | No              |\n| `RETENTION_DAYS`       | Number of days to keep backups                                                 | No (default: 0) |\n| `VERIFY_BACKUP`        | Verify backup after creation (1=yes, 0=no)                                     | No (default: 1) |\n| `RESTIC_PASSWORD`      | Password for restic repository                                                 | No*             |\n| `RESTIC_PASSWORD_FILE` | Path to file containing restic password                                        | No*             |\n| `ENABLE_BACKUP`        | Enable/disable backup functionality                                            | No (default: 1) |\n| `ENABLE_RESTORE`       | Enable/disable restore functionality                                           | No (default: 1) |\n| `ENABLE_PUSH`          | Enable/disable push functionality                                              | No (default: 1) |\n| `ENABLE_PULL`          | Enable/disable pull functionality                                              | No (default: 1) |\n\n*Either `RESTIC_PASSWORD` or `RESTIC_PASSWORD_FILE` must be set\n\n#### Backup Repository Modes\n\nThe script supports two modes for managing the backup repository:\n\n1. **Local + Remote Sync mode** (default)\n   - Backups are created locally in `LOCAL_BACKUP_REPO`\n   - The entire `CONFIG_DIR` (including the repository) is synced to/from remote with rclone\n   - Good for frequent backups with occasional remote synchronization\n\n2. **Direct Remote Repository mode**\n   - Set by defining `RESTIC_REPOSITORY` with a remote URL (s3, sftp, rest, etc.)\n   - Backup operations work directly with the remote repository\n   - Push/Pull operations are disabled in this mode\n   - Good for direct cloud backups without local copies\n\n#### Verbosity Levels\n\nThe script supports multiple verbosity levels to control the amount of information displayed:\n\n- Level 0: Minimal output (only basic logs)\n- Level 1 (`-v`): Basic progress and information\n- Level 2 (`-vv`): Detailed progress and debug information\n- Level 3 (`-vvv`): Maximum verbosity for troubleshooting\n\n#### Profiles\n\nMultiple backup profiles can be defined to manage different backup scenarios:\n\n1. Create a profile file at `${CONFIG_DIR}/profiles/\u003cprofile_name\u003e.sh`\n2. Add specific configuration variables for that profile\n3. Use the profile with `-p` or `--profile` option when running commands\n\n#### Example Files\n\nExample `init.sh`:\n\n```bash\n#!/bin/bash\n# Basic configuration for backup script\n\n# Required: Set the configuration directory\nexport CONFIG_DIR=$(pwd)/local\n\n# Directories to backup (space-separated)\nexport BACKUP_DIRECTORIES=\"/projects /home/user/documents\"\n\n# Remote repository configuration\nexport RCLONE_REMOTE=\"remote:backup/projects-$(hostname)\"\n\n# Backup retention (days)\nexport RETENTION_DAYS=30\n\n# Password file for restic repository\nexport RESTIC_PASSWORD_FILE=\"${CONFIG_DIR}/restic-password.txt\"\n\n# Optional: Configure verbosity (0=none, 1=basic, 2=detailed, 3=maximum)\nexport VERBOSE=1\n```\n\nExample profile for server backups (`local/profiles/server.sh`):\n\n```bash\n#!/bin/bash\n# Server-specific backup settings\n\nexport BACKUP_DIRECTORIES=\"/etc /var/www /opt/application/data\"\nexport RETENTION_DAYS=60\nexport VERBOSE=1\n```\n\nExample `local/rclone.conf` file for SFTP uploads:\n\n```ini\n[remote]\ntype = sftp\nhost = example.com\nuser = backup-user\nport = 22\n```\n\nExample `local/rclone.conf` file for Hetzner storage box:\n\n```ini\n[remote]\ntype = sftp\nhost = u123456.your-storagebox.de\nuser = u123456\nport = 23\n```\n\nExample `local/exclude.txt` for excluding specific patterns:\n\n```\n# Patterns to exclude from backup\n**/.DS_Store\n**/node_modules\n**/*.log\n**/tmp\n**/temp\n**/.cache\n```\n\n#### Compatibility Notes\n\n- The script is compatible with both newer and older versions of restic\n- Some advanced features (like the `stats` command) may not be available in older restic versions\n- For best results, using restic 0.12.0 or later is recommended\n\n#### License\n\nThis code is released under the MIT License. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiversal-development%2Frearden-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funiversal-development%2Frearden-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiversal-development%2Frearden-backup/lists"}