Package: edwh-restic-plugin
edwh-restic-pluginTable of ContentsInstallationwhat is resticconfiguring edwh resticbackuprestoresnapshotsconfigureLicenseInstalling the pluginpip install edwh-restic-pluginBut probably you want to install the wholeedwhpackage:pipx install edwh[plugins,omgeving]#orpipx install edwh[restic]What is Restic?Restic is a program that automatically stores backups in a separate repository, securing them with a password and compressing them.
There are multiple options for storing backups, including locally on the same host, SFTP to a remote host,
and remotely to various systems and providers such as Amazon, REST, Minio, Wasabi, Alibaba Cloud, Openstack, Backblaze,
Azure, Google, and rclone.Configuringedwh restic.*For EDWH, they use local storage, SFTP, Backblaze, S3, and Openstack.Creating a new repositoryTo create a new repository, you need the local path to the folder where the backup should be stored,
or an SSH connection for SFTP with a path to the folder where the backup should be stored.
It's important to note that SFTP servers may close the connection if they don't receive data,
which can happen if Restic is processing large amounts of unchanged data.
To avoid this issue, you can use the option "ServerAliveInterval 60 & ServerAliveCountMax 240" in the SSH config.For Backblaze, you need an account ID and Key, as well as the name of the bucket.
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.commands:local:restic init –repo /path/to/repoSFTP:restic -r sftp:user@host:/path/to/repo initNote that SFTP servers may close the connection if they don't receive data, which can happen if
Restic is processing large amounts of unchanged data. To avoid this issue, you can use the
optionServerAliveInterval 60andServerAliveCountMax 240in the SSH config.Backblaze:restic -r b2:bucketname:/path/to/repo initOpenstack:restic -r swift:container_name:/repo initWorking withcaptain-hooksshell scriptsbacking up file(s) using Restic with .shexample for backing up files using no streamrestic $HOST -r $URI backup --tag files *.shexample for backing up files using streams:(place stream here) | restic $HOST -r $URI backup --tag stream --stdin --stdin-filename (file_name)NOTE: put restore commands as an .sh file in a folder named captain-hooks, the folder needs to be in the same dir
you run the inv restore in. SEE examples/captain-hooks for more infovariables you can use in the backup sh file$HOST$URIrestoring file(s) using Restic with .shexample for restoring files without using streams:restic $HOST -r $URI restore latest --target recover_data --tag filesexample for restoring files using streams:restic $HOST -r $URI dump $SNAPSHOT --tag stream (file_name)NOTE: put restore commands as an .sh file in a folder named captain-hooks, the folder needs to be in the same dir
you run the inv restore in. See examples/captain-hooks for more infovariables you can use in the restore sh file$HOST$URI$SNAPSHOTUsingew restic.backupexample:ew restic.backup -v -c=localPossible arguments forew restic.backup:target: restore files in captain hooks to be executedconnection_choice: connection to use for access to the repository. Can be OS, SFTP, B2, or
local.snapshot: "latest" by default, seesnapshotsfor more informationmessage: store a descriptive message with the backup, default message isdatetime.localtime()verbose: add verbosity, printing more debug information while processing the activity.Requirements:For local storage a path to the folder where the backup should be stored is required.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.For Backblaze, you need a B2 account-ID and key, as well as the name of the bucket to store
the backup.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.For all of the above requirements, you also need to specify what needs to be backed up.Usingew restic.restoreexample:ew restic.restore -v -c=localPossible arguments for theew restic.restoreconnection_choice: connection to use for access to the repository. Can be OS, SFTP, B2, or
local.snapshot: "latest" by default, seesnapshotsfor more informationtarget: restore files in captain hooks to be executedverbose: add verbosity, printing more debug information while processing the activity.Usingew restic.snapshotslist of all backups that are madeexample:ew restic.snapshots -c localGebruikt connectie:  local
ID        Time                 Host       Tags
------------------------------------------------
71cde9e8  2023-04-05 17:49:21  ubuntu-hp  stream : [hello world!]
d845dc99  2023-04-05 17:49:21  ubuntu-hp  message
                                          71cde9e8
------------------------------------------------
2 snapshotsUsingew restic.configuresetting up the .env file for the specified repository. Which can be OS, SFTP, B2, or local.Usingew restic.runthis command sets up an eviroment with the connection choice of your choosing and runs the input command until the user
types "exit".Possible arguments forew restic.backup:connection_choice(-c): connection to use for access to the repository. Can be OS, SFTP, B2, or
local.Licenseedwh-restic-pluginis distributed under the terms of theMITlicense.
Seethe licensefor details.