{"id":13535929,"url":"https://github.com/peterrus/restic-wrapper","last_synced_at":"2025-04-02T02:31:40.339Z","repository":{"id":49390895,"uuid":"338772793","full_name":"peterrus/restic-wrapper","owner":"peterrus","description":"Simple bash wrapper to source .env configuration files for Restic. Facilitates both manual CLI execution and scheduled (cron) execution.","archived":false,"fork":false,"pushed_at":"2022-08-21T15:17:04.000Z","size":23,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T14:26:33.592Z","etag":null,"topics":["backup","bash","restic","restic-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterrus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-14T09:49:17.000Z","updated_at":"2023-12-01T17:16:56.000Z","dependencies_parsed_at":"2022-08-12T20:11:12.186Z","dependency_job_id":null,"html_url":"https://github.com/peterrus/restic-wrapper","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterrus%2Frestic-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterrus%2Frestic-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterrus%2Frestic-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterrus%2Frestic-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterrus","download_url":"https://codeload.github.com/peterrus/restic-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246743701,"owners_count":20826589,"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","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":["backup","bash","restic","restic-script"],"created_at":"2024-08-01T09:00:32.229Z","updated_at":"2025-04-02T02:31:40.041Z","avatar_url":"https://github.com/peterrus.png","language":"Shell","readme":"# Restic Backup Wrapper\n\nThis wrapper attempts to make running restic a bit easier. It reads configuration files (in the form of `.env` files) and provides shortcuts to be used in manual and automated (cronjob's) situations alike. I tried to keep the script as simple as possible so you can hack on it to suit your needs. Notifications about the result of a backup job are handled by calling a script called `restic_notify`. The one provided in this repository sends mail over SMTP.\n\nThis script should work without problems on most linux distributions. I can not vouch for OSX but feedback is welcome.\n\n## Setup\n\nAfter checking out this repo (or just downloading the script) create config files in the `configs/` directory. There is already an example in this directory. The file name of the `.env` file dictates the 'job name'. You will need this later. Please be aware that you currently need to create an `excludefile` even if you are not using any excludes. This file can be empty.\n\n(See [Restic Docs](https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files) for examples)\n\nWhen you have created the config files it might be wise to back them up for safekeeping using `./restic_wrapper -a export-config`.\n\nIf you have not initialized a Restic repository at the location you set in `RESTIC_REPOSITORY` be sure to create one using `./restic_wrapper -b example-job -a run -r init`.\n\nYou are now ready to use the wrapper. See `./restic_wrapper` (without parameters) for all options.\n\n## Notifications\n\nBy default restic-wrapper outputs all status information to the terminal. You can route that output to the `restic_notify` script by providing the `-m` flag like so: `./restic_wrapper -b example-job -a backup -m`.\n\nThe `restic_notify` script in this repository sends email over SMTP and sets the subject according to whether or not the backup job succeeded. Mail is sent using `s-nail` so be sure to install that on your system.\n\nSee `configs/smtp.env.example` and rename it to `configs/smtp.env`.\n\n## Scheduled execution\nYou can set up a cronjob for (for example) nightly backups at 3:30.\n\n```\n 30 3 * * *       ~/restic_wrapper/restic_wrapper -b example-job -a backup-full -m\n```\n\nIf your system has an [MTA](https://cronitor.io/cron-reference/no-mta-installed-discarding-output) installed you will also get email if restic_wrapper itself fails for some reason but because most users do not have a properly configured MTA I chose to integrate basic notification functionality in restic_wrapper. Another advantage of letting restic_wrapper handle the notifications is that it can send different mails for failed and succeeded jobs without needing a lot of bash magic (which not everyone might be comfortable with).\n\n## Changelog\n- **v0.3.0**: \n  - Keep configs in separate dir\n  - provide example configs (also for rclone)\n  - make `restic_notify` compatible with newer versions of `s-nail`\n- **v0.2.1**: Miscellaneous documentation updates.\n- **v0.2.0**: Externalize notification functionality to make the script a lot simpler (and refactored a bunch).\n- **v0.1.0**: Added `export-config` option to create a tarball of all your config files.\n","funding_links":[],"categories":["Shell","Wrappers"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterrus%2Frestic-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterrus%2Frestic-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterrus%2Frestic-wrapper/lists"}