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

general: cleanup and documentation

parent a337a5c0
No related branches found
No related tags found
No related merge requests found
...@@ -47,38 +47,69 @@ TBD: ...@@ -47,38 +47,69 @@ TBD:
## Install ## Install
``` ```
git clone git@gitlab.flab.cesnet.cz:bodik/rwm.git /opt/rwm git clone git@gitlab.flab.cesnet.cz:bodik/rwm.git /opt/rwm
cd /opt/rwm cd /opt/rwm
make venv
make install make install
``` ```
## Development
```
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
* s3 + 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: ""
__EOF__
rwm rclone_crypt sync /data rwmbe:/
rwm rclone_crypt lsl rwmbe:/
```
## restic: restic backup
``` ```
cp rwm.conf.example rwm.conf cat > rwm.conf <<__EOF__
edit rwm.conf RWM_S3_ENDPOINT_URL: ""
rwm rcc sync /data rwmbe:/ RWM_S3_ACCESS_KEY: ""
rwm rcc lsl rwmbe:/ RWM_S3_SECRET_KEY: ""
RWM_RESTIC_BUCKET: "rwmrestic"
RWM_RESTIC_PASSWORD: ""
__EOF__
rwm restic init
rwm restic backup /data
rwm restic snapshots
``` ```
### Notes ### Notes
### Passing arguments
Passthrough full arguments to underlyin tool with "--" (eg. `rwm rclone -- ls --help`).
### rclone sync
* https://rclone.org/commands/rclone_sync/ * https://rclone.org/commands/rclone_sync/
It is always the contents of the directory that is synced, not the directory itself. It is always the contents of the directory that is synced, not the directory itself.
So when source:path is a directory, it's the contents of source:path that are copied, 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. not the directory name and contents. See extended explanation in the copy command if unsure.
### rclone crypt
* corect, fails to download corrupted files * corect, fails to download corrupted files
``` ```
root@bacula-test:/opt/rwm# ./rwm.py rcc copy rwmbe:/testfile.txt .
2024/03/23 16:54:31 ERROR : testfile.txt: Failed to copy: failed to open source object: not an encrypted file - bad magic string 2024/03/23 16:54:31 ERROR : testfile.txt: Failed to copy: failed to open source object: not an encrypted file - bad magic string
2024/03/23 16:54:31 ERROR : Attempt 1/3 failed with 1 errors and: failed to open source object: not an encrypted file - bad magic string 2024/03/23 16:54:31 ERROR : Attempt 1/3 failed with 1 errors and: failed to open source object: not an encrypted file - bad magic string
``` ```
......
...@@ -2,8 +2,6 @@ RWM_S3_ENDPOINT_URL: "" ...@@ -2,8 +2,6 @@ RWM_S3_ENDPOINT_URL: ""
RWM_S3_ACCESS_KEY: "" RWM_S3_ACCESS_KEY: ""
RWM_S3_SECRET_KEY: "" RWM_S3_SECRET_KEY: ""
# RWM_RCLONE
RWM_RCLONE_CRYPT_BUCKET: "rwmcrypt" RWM_RCLONE_CRYPT_BUCKET: "rwmcrypt"
RWM_RCLONE_CRYPT_PASSWORD: "" RWM_RCLONE_CRYPT_PASSWORD: ""
......
...@@ -153,9 +153,9 @@ def main(argv=None): ...@@ -153,9 +153,9 @@ def main(argv=None):
parser = ArgumentParser(description="restics3 worm manager") parser = ArgumentParser(description="restics3 worm manager")
parser.add_argument("--config", default="rwm.conf") parser.add_argument("--config", default="rwm.conf")
subparsers = parser.add_subparsers(title="commands", dest="command", required=False) subparsers = parser.add_subparsers(title="commands", dest="command", required=False)
version_cmd_parser = subparsers.add_parser("version", help="show version")
subparsers.add_parser("version", help="show version")
aws_cmd_parser = subparsers.add_parser("aws", help="aws command") aws_cmd_parser = subparsers.add_parser("aws", help="aws command")
aws_cmd_parser.add_argument("cmd_args", nargs="*") aws_cmd_parser.add_argument("cmd_args", nargs="*")
rc_cmd_parser = subparsers.add_parser("rclone", help="rclone command") rc_cmd_parser = subparsers.add_parser("rclone", help="rclone command")
......
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