update backup article

main
yova 2 months ago
parent f0bc42e032
commit 0795449de3

@ -1,7 +1,7 @@
--- ---
title: Using OVH PCA with backupninja title: Using OVH PCA with backupninja
description: Accessing the OVH Public cloud archive with the automated backup tool backupninja using its duplicity backend description: Accessing the OVH Public cloud archive with the automated backup tool backupninja using its duplicity backend
date: 2022-03-03 date: 2024-03-06
--- ---
## Motivation ## Motivation
@ -36,17 +36,18 @@ OVH provides a cheap way for longterm storing backup data, the Public Cloud Arch
### On OVH ### On OVH
- Create a new user unter Cloud Archive → Project Management → Users & Roles - Create new Public Cloud project
- Create a new user unter Public Cloud → Project Management → Users & Roles
- Give the user the Role `ObjectStore operator` - Give the user the Role `ObjectStore operator`
- Note username and **password** - Note username and **password**
- Get TenandID - Get TenantID
- click 3 dots on the right of the users row. Click Download OpenStack's RC file. Here you can select a region where the PCA should be set up - click 3 dots on the right of the users row. Click Download OpenStack's RC file. Here you can select a region where the PCA should be set up
- Note the `OS_TENANT_ID`, here you also can extract `OS_USERNAME` and `OS_REGION_NAME` - Note value of `OS_TENANT_ID`
## Installation ## Install python modules
- Be sure to have at least version 0.8.21 of duplicity - Be sure to use latest issues, so install python modules with pip:
- `pip3 install duplicity>=0.8.21 python-swiftclient python-keystoneclient` - `pip3 install duplicity python-swiftclient python-keystoneclient fasteners`
## Configuration ## Configuration
- 3 files are used for this: - 3 files are used for this:
@ -60,7 +61,7 @@ OVH provides a cheap way for longterm storing backup data, the Public Cloud Arch
- Most important options are: - Most important options are:
``` ```
options = --volsize 200 --archive-dir /tmp --file-prefix-manifest 'hot_' --file-prefix-signature 'hot_' --file-prefix-archive 'cold_' options = --archive-dir /tmp --file-prefix-manifest 'hot_' --file-prefix-signature 'hot_' --file-prefix-archive 'cold_'
testconnect = no testconnect = no
[gpg] [gpg]
@ -81,10 +82,24 @@ desturl = 'multi:///etc/ovh-config.json?mode=mirror&onfail=abort'
- This is the **credentials** file for OVH. Get this [template](/texts/ovh-config.json) - This is the **credentials** file for OVH. Get this [template](/texts/ovh-config.json)
- adapt the `url` keys to something meaningful ex. `backedupserver1_cold` and `backedupserver2_hot`. This will be the names of the Cloud Archives resp. Object Stores - adapt the `url` keys to something meaningful ex. `backedupserver1_cold` and `backedupserver2_hot`. This will be the names of the Cloud Archives resp. Object Stores
- change `PCA_TENANTID` and `SWIFT_TENANTID` to noted `OS_TENANT_ID` - change `PCA_TENANTID` and `SWIFT_TENANTID` to noted `OS_TENANT_ID`
- change `PCA_USERNAME` and `SWIFT_USERNAME` to noted `OS_USERNAME` - change `PCA_USERNAME` and `SWIFT_USERNAME` to noted username
- do the same for Password and Regionname - do the same for Password and Regionname
- Make sure minimal access rights with `chmod 600` - Make sure minimal access rights with `chmod 600`
## testing ## backup
- do a test run - do a test run
- `backupninja -d -n` `backupninja -d -n`
- backupninja should start every day at a predefined time as specified in `/etc/backupninja.conf`
## restore
- create a `ovh-conf.json` file for the credentials like for backup
- run (preferably as root, so user ownership can also be restored):
```sh
duplicity --file-prefix-manifest 'hot_' \\
--file-prefix-signature 'hot_' \\
--file-prefix-archive 'cold_' \\
--encrypt-key EXAMPLEKEYID \\
--sign-key EXAMPLEKEYID \\
--path-to-restore PATH/IN/BACKUP \\
restore 'multi:///PATH/TO/ovh-config.json?mode=mirror&onfail=abort' LOCAL/SUBFOLDER
```

@ -1,6 +1,6 @@
# passed directly to duplicity # passed directly to duplicity
options = --volsize 200 --archive-dir /tmp --file-prefix-manifest 'hot_' --file-prefix-signature 'hot_' --file-prefix-archive 'cold_' options = --archive-dir /tmp --file-prefix-manifest 'hot_' --file-prefix-signature 'hot_' --file-prefix-archive 'cold_'
# default is 0, but set to 19 if you want to lower the priority. # default is 0, but set to 19 if you want to lower the priority.
nicelevel = 19 nicelevel = 19

Loading…
Cancel
Save