Skip to content
Snippets Groups Projects
Commit 4e315830 authored by Radoslav Bodó's avatar Radoslav Bodó
Browse files

general: update docs

parent 2644e4d8
No related branches found
No related tags found
No related merge requests found
......@@ -46,59 +46,100 @@ TBD:
* number of object files vs size
## Install
```
git clone git@gitlab.flab.cesnet.cz:bodik/rwm.git /opt/rwm
cd /opt/rwm
make install
```
## Usage
Beside the WORM management features, `rwm` can also be used as simple wrapper to other S3 related
tools such as `aws` CLI, `rclone` and `restic`.
It can be also used as simple backup manager for intended usecases.
## Development
### Install
```
git clone git@gitlab.flab.cesnet.cz:bodik/rwm.git /opt/rwm
cd /opt/rwm
make install
make venv
. venv/bin/activate
```
## simple copy: rclone with crypt overlay
### Simple copy: rclone with crypt overlay
```
cat > rwm.conf <<__EOF__
RWM_S3_ENDPOINT_URL: ""
RWM_S3_ACCESS_KEY: ""
RWM_S3_SECRET_KEY: ""
RWM_RCLONE_CRYPT_BUCKET: "rwmcrypt"
RWM_RCLONE_CRYPT_PASSWORD: ""
rwm_s3_endpoint_url: ""
rwm_s3_access_key: ""
rwm_s3_secret_key: ""
rwm_rclone_crypt_bucket: "rwmcrypt"
rwm_rclone_crypt_password: ""
__EOF__
rwm rclone_crypt sync /data rwmbe:/
rwm rclone_crypt lsl rwmbe:/
```
## restic: restic backup
### Restic: manual restic backup
```
cat > rwm.conf <<__EOF__
RWM_S3_ENDPOINT_URL: ""
RWM_S3_ACCESS_KEY: ""
RWM_S3_SECRET_KEY: ""
RWM_RESTIC_BUCKET: "rwmrestic"
RWM_RESTIC_PASSWORD: ""
rwm_s3_endpoint_url: ""
rwm_s3_access_key: ""
rwm_s3_secret_key: ""
rwm_restic_bucket: "rwmrestic"
rwm_restic_password: ""
__EOF__
rwm restic init
rwm restic backup /data
rwm restic snapshots
```
### RWM: simple backups
```
cat > rwm.conf <<__EOF__
rwm_s3_endpoint_url: ""
rwm_s3_access_key: ""
rwm_s3_secret_key: ""
rwm_restic_bucket: "rwmrestic"
rwm_restic_password: ""
rwm_backups:
backup1:
filesdirs:
- /etc
- /data
excludes:
- *.cache
extras:
- --tag
- mytag1
rwm_retention:
keep-daily: "14"
keep-weekly: "20"
__EOF__
rwm backup_all
```
## Notes
#### Development
```
git clone git@gitlab.flab.cesnet.cz:bodik/rwm.git /opt/rwm
cd /opt/rwm
make install
make venv
. venv/bin/activate
```
### Notes
### Passing arguments
Passthrough full arguments to underlyin tool with "--" (eg. `rwm rclone -- ls --help`).
### rclone sync
* https://rclone.org/commands/rclone_sync/
......@@ -106,6 +147,7 @@ It is always the contents of the directory that is synced, not the directory its
So when source:path is a directory, it's the contents of source:path that are copied,
not the directory name and contents. See extended explanation in the copy command if unsure.
### rclone crypt
* corect, fails to download corrupted files
......
......@@ -12,5 +12,5 @@ rwm_restic_bucket: "rwmcrypt"
rwm_restic_password: ""
# backup
rwm_backups: []
rwm_retention: []
rwm_backups: {}
rwm_retention: {}
......@@ -189,8 +189,8 @@ class RWM:
excludes = []
for item in conf.get("excludes", []):
excludes += ["--exclude", item]
backup_extras = conf.get("backup_extras", [])
cmd_args = ["backup"] + backup_extras + excludes + conf["filesdirs"]
extras = conf.get("extras", [])
cmd_args = ["backup"] + extras + excludes + conf["filesdirs"]
return self.restic_cmd(cmd_args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment