{"id":19260091,"url":"https://github.com/fhofherr/restic-systemd-backup","last_synced_at":"2026-06-13T06:32:44.990Z","repository":{"id":139501427,"uuid":"570305071","full_name":"fhofherr/restic-systemd-backup","owner":"fhofherr","description":"Collection  of systemd units and shell scripts that allow me to backup my systems.","archived":false,"fork":false,"pushed_at":"2024-06-02T17:49:45.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T18:26:49.104Z","etag":null,"topics":["backup","restic","restic-backup","restic-backups","systemd-service","systemd-timer"],"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/fhofherr.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":"2022-11-24T21:09:47.000Z","updated_at":"2024-06-02T17:45:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"f90ef73f-9fdb-47b4-a325-7925f1bd4d2b","html_url":"https://github.com/fhofherr/restic-systemd-backup","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/fhofherr/restic-systemd-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhofherr%2Frestic-systemd-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhofherr%2Frestic-systemd-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhofherr%2Frestic-systemd-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhofherr%2Frestic-systemd-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fhofherr","download_url":"https://codeload.github.com/fhofherr/restic-systemd-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhofherr%2Frestic-systemd-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34275067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"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":["backup","restic","restic-backup","restic-backups","systemd-service","systemd-timer"],"created_at":"2024-11-09T19:18:52.655Z","updated_at":"2026-06-13T06:32:44.968Z","avatar_url":"https://github.com/fhofherr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# restic-systemd-backup\n\n`restic-systemd-backup` is a collection of systemd units and shell\nscripts that allow me to backup my systems.\n\nThe initial idea for the code contained in this repository came from\n[this blog post](https://tdem.in/post/restic-with-systemd/) and [this\ngithub issue](https://github.com/restic/restic/issues/1015).\n\n## Usage\n\nThis repository mostly is a collection of scripts and systemd units.\nThe [`Makefile`](./Makefile) provides a convenient way to copy the files\nin the repository to the system. However, additional manual work is\nrequired before first use.\n\nTemplated systemd units provided by this repository assume that a\ndirectory containing further configuration exists under\n`$REPO_DIR/etc/restic-systemd-backup/%I/`.\n\n### Prerequisites\n\nThe following prerequisites must be met in order to use\n`restic-systemd-backup`:\n\n1. The `restic` binary must be installed on the system.\n2. A designated backup user must be created. By default this user is\n   assumed to be called `restic`.\n\n### Installation\n\nIn order to install the files to `$REPO_DIR/etc/restic-systemd-backup/`\nexecute the following command:\n\n    sudo make install\n\nThe `REPO_DIR` defaults to `/usr/local`. In order to change prefix\nexecute:\n\n    sudo REPO_DIR=\"/somewhere/else\" make install\n\n### Filesystem backups\n\nFilesystem level backups are provided by the\n[`restic-backup-fs@.service`](./systemd/restic-backup-fs@.service)\nservice. In order to schedule regular filesystem level backups execute\nthe following steps:\n\n1. Create a directory `$REPO_DIR/etc/restic-systemd-backup/\u003cinstance-name\u003e`.\n2. Create the file\n   `$REPO_DIR/etc/restic-systemd-backup/\u003cinstance-name\u003e/restic` setting any\n   environment variables used to configure `restic`. At the very minimum\n   it must set `RESTIC_REPOSITORY` and `RESTIC_PASSWORD`. The [restic\n   documentation](https://restic.readthedocs.io/en/stable/040_backup.html#environment-variables)\n   describes additional ways to configure restic. Note that if the file\n   contains `RESTIC_PASSWORD` it should be readable by the `restic` user\n   only.\n3. Create the file\n   `$REPO_DIR/etc/restic-systemd-backup/\u003cinstance-name\u003e/files` defining\n   which files and directories restic should backup. The [restic\n   documentation](https://restic.readthedocs.io/en/stable/040_backup.html#including-files)\n   for the `--files-from` flag explains the format of the file.\n4. Enable and start the\n   [`restic-backup-fs@.timer`](./systemd/restic-backup-fs@.timer).\n\n### Backup removal\n\nThe\n[`restic-backup-forget@.service`](./systemd/restic-backup-forget@.service)\nallows to automatically remove outdated backups based on a fixed\nschedule. Once the filesystem level backups are configured the only\nthing left to do is to enable and start the\n[`restic-backup-forget@.timer`](./systemd/restic-backup-forget@.timer).\n\n### Failure notifications\n\nThe [`restic-backup-failed@.service`] provides notifications in case one\nof the `restic-backup-*.service` units fails. In order to enable\nnotifications for a instance create a directory\n`$REPO_DIR/etc/restic-with-systemd/\u003cinstance-name\u003e/notify.d` and place one\nor more executable files into it.\n\nSee the `notify-failed-*` files in the [`scripts`](./scripts) directory\nfor example. Of course one or more of the `notify-failed-*` can by\ncopied or symlinked to the `notify.d` directory.\n\n## License\n\nCopyright © 2022 Ferdinand Hofherr\n\nDistributed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhofherr%2Frestic-systemd-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffhofherr%2Frestic-systemd-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhofherr%2Frestic-systemd-backup/lists"}