{"id":23002999,"url":"https://github.com/educationwarehouse/edwh-restic-plugin","last_synced_at":"2025-08-14T01:31:42.091Z","repository":{"id":151527609,"uuid":"624338529","full_name":"educationwarehouse/edwh-restic-plugin","owner":"educationwarehouse","description":"`edwh` plugin for restic backups","archived":false,"fork":false,"pushed_at":"2024-11-21T16:40:43.000Z","size":229,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-21T17:37:56.966Z","etag":null,"topics":["backup","edwh","invoke","python","restic"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/edwh-restic-plugin/","language":"Python","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/educationwarehouse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2023-04-06T08:48:51.000Z","updated_at":"2024-11-21T16:40:46.000Z","dependencies_parsed_at":"2023-05-05T19:34:03.988Z","dependency_job_id":"4b3a42b6-aeb3-4ca2-977a-beee2c353506","html_url":"https://github.com/educationwarehouse/edwh-restic-plugin","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-restic-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-restic-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-restic-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-restic-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/educationwarehouse","download_url":"https://codeload.github.com/educationwarehouse/edwh-restic-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229790999,"owners_count":18124608,"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","edwh","invoke","python","restic"],"created_at":"2024-12-15T07:13:12.177Z","updated_at":"2024-12-15T07:13:12.767Z","avatar_url":"https://github.com/educationwarehouse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# edwh-restic-plugin\n\n[![PyPI - Version](https://img.shields.io/pypi/v/edwh-restic-plugin.svg)](https://pypi.org/project/edwh-restic-plugin)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/edwh-restic-plugin.svg)](https://pypi.org/project/edwh-restic-plugin)\n\n-----\n\n**Table of Contents**\n\n- [Installation](#installing-the-plugin)\n- [what is restic](#what-is-restic)\n- [configuring edwh restic](#configuring-edwh-restic)\n- [backup](#using-ew-resticbackup)\n- [restore](#using-ew-resticrestore)\n- [snapshots](#using-ew-resticsnapshots)\n- [configure](#using-ew-resticconfigure)\n- [License](#license)\n\n## Installing the plugin\n\n```console\npip install edwh-restic-plugin\n```\n\nBut probably you want to install the whole `edwh` package:\n\n```console\npipx install edwh[plugins,omgeving]\n# or\npipx install edwh[restic]\n```\n\n## What is Restic?\nRestic is a program that automatically stores backups in a separate repository, securing them with a password and compressing them. \nThere are multiple options for storing backups, including locally on the same host, SFTP to a remote host,\nand remotely to various systems and providers such as Amazon, REST, Minio, Wasabi, Alibaba Cloud, Openstack, Backblaze, \nAzure, Google, and rclone. \n\n## Configuring `edwh restic.*`\nFor EDWH, they use local storage, SFTP, Backblaze, S3, and Openstack.\n\n### Creating a new repository\nTo create a new repository, you need the local path to the folder where the backup should be stored,\nor an SSH connection for SFTP with a path to the folder where the backup should be stored. \nIt's important to note that SFTP servers may close the connection if they don't receive data, \nwhich can happen if Restic is processing large amounts of unchanged data. \nTo avoid this issue, you can use the option \"ServerAliveInterval 60 \u0026 ServerAliveCountMax 240\" in the SSH config.\n\nFor Backblaze, you need an account ID and Key, as well as the name of the bucket. \nFor Openstack, you need to specify which Keystone to use, environment variables (as shown in the image), \nand the name of the container. \nRestic can also work with an OpenStack RC file.\n### commands:\n\n#### local:\n\u003e restic init –repo /path/to/repo\n\n#### SFTP:\n\u003e restic -r sftp:user@host:/path/to/repo init\n\nNote that SFTP servers may close the connection if they don't receive data, which can happen if \nRestic is processing large amounts of unchanged data. To avoid this issue, you can use the \noption `ServerAliveInterval 60` and `ServerAliveCountMax 240` in the SSH config.\n\n#### Backblaze:\n\u003e restic -r b2:bucketname:/path/to/repo init\n\n#### Openstack:\n\u003e restic -r swift:container_name:/repo init\n---\n### Working with `captain-hooks` shell scripts\n\n#### backing up file(s) using Restic with .sh\nexample for backing up files using no stream\n\u003erestic $HOST -r $URI backup --tag files *.sh\n\nexample for backing up files using streams:\n\u003e (place stream here) | restic $HOST -r $URI backup --tag stream --stdin --stdin-filename (file_name)\n\n\u003e NOTE: put restore commands as an .sh file in a folder named captain-hooks, the folder needs to be in the same dir\n\u003e you run the inv restore in. SEE examples/captain-hooks for more info\n\n**variables you can use in the backup sh file**\n- $HOST\n- $URI\n\n---\n\n#### restoring file(s) using Restic with .sh\nexample for restoring files without using streams:\n\u003e restic $HOST -r $URI restore latest --target recover_data --tag files\n\nexample for restoring files using streams:\n\u003e restic $HOST -r $URI dump $SNAPSHOT --tag stream (file_name)\n\n\u003e NOTE: put restore commands as an .sh file in a folder named captain-hooks, the folder needs to be in the same dir\n\u003e you run the inv restore in. See examples/captain-hooks for more info\n\n**variables you can use in the restore sh file**\n- $HOST\n- $URI\n- $SNAPSHOT\n\n---\n## Using `ew restic.backup`\n**example**: `ew restic.backup -v -c=local`\n\nPossible arguments for `ew restic.backup`:\n- **target**: restore files in captain hooks to be executed\n- **connection_choice**: connection to use for access to the repository. Can be OS, SFTP, B2, or \n  local.\n- **snapshot**: \"latest\" by default, see [snapshots](#using-ew-resticsnapshots) for more information\n- **message**: store a descriptive message with the backup, default message is `datetime.localtime()`\n- **verbose**: add verbosity, printing more debug information while processing the activity. \n\n**Requirements:**\n\n- For local storage a path to the folder where the backup should be stored is required.\n- For SFTP, an SSH connection with public/private key in an agent or via SSH config, and the path to the folder where the backup should be stored. \n- For Backblaze, you need a B2 account-ID and key, as well as the name of the bucket to store \n  the backup. \n- For Openstack, you need to specify which Keystone to use, environment variables (as shown in the image), and the name of the container. Restic can also work with an OpenStack RC file.\n- For all of the above requirements, you also need to specify what needs to be backed up.\n\n---\n## Using `ew restic.restore`\n\n**example**: `ew restic.restore -v -c=local`\n\nPossible arguments for the `ew restic.restore`\n- **connection_choice**: connection to use for access to the repository. Can be OS, SFTP, B2, or \n  local.\n- **snapshot**: \"latest\" by default, see [snapshots](#using-ew-resticsnapshots) for more information\n- **target**: restore files in captain hooks to be executed\n- **verbose**: add verbosity, printing more debug information while processing the activity. \n\n---\n## Using `ew restic.snapshots`\n\nlist of all backups that are made\n\n**example**: `ew restic.snapshots -c local`\n\n```\nGebruikt connectie:  local\nID        Time                 Host       Tags\n------------------------------------------------\n71cde9e8  2023-04-05 17:49:21  ubuntu-hp  stream : [hello world!]\nd845dc99  2023-04-05 17:49:21  ubuntu-hp  message\n                                          71cde9e8\n------------------------------------------------\n2 snapshots\n```\n\n---\n\n## Using `ew restic.configure`\nsetting up the .env file for the specified repository. Which can be OS, SFTP, B2, or local.\n\n\n## Using `ew restic.run`\nthis command sets up an eviroment with the connection choice of your choosing and runs the input command until the user \ntypes \"exit\".\n\nPossible arguments for `ew restic.backup`:\n- **connection_choice(-c)**: connection to use for access to the repository. Can be OS, SFTP, B2, or \n  local.\n\n\n## License\n`edwh-restic-plugin` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\nSee [the license](LICENSE.txt) for details. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feducationwarehouse%2Fedwh-restic-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feducationwarehouse%2Fedwh-restic-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feducationwarehouse%2Fedwh-restic-plugin/lists"}