diff --git a/README.md b/README.md index df6e49dc95f39d4d62ccad30a21f54d18616c27f..40b520fbf84d65173a1605e0cc812a98aa8c37ea 100644 --- a/README.md +++ b/README.md @@ -47,38 +47,69 @@ TBD: ## Install - ``` git clone git@gitlab.flab.cesnet.cz:bodik/rwm.git /opt/rwm cd /opt/rwm -make venv 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 -* 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 -edit rwm.conf -rwm rcc sync /data rwmbe:/ -rwm rcc lsl rwmbe:/ +cat > rwm.conf <<__EOF__ +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 ``` + ### Notes +### Passing arguments + +Passthrough full arguments to underlyin tool with "--" (eg. `rwm rclone -- ls --help`). + +### rclone sync * https://rclone.org/commands/rclone_sync/ 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, not the directory name and contents. See extended explanation in the copy command if unsure. +### rclone crypt * 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 : Attempt 1/3 failed with 1 errors and: failed to open source object: not an encrypted file - bad magic string ``` diff --git a/rwm.conf.example b/rwm.conf.example index 6413b7d2bb70829e3b07d6fb01c8011772846e65..a31b410acf939fa0c7112697c538b54dcbf56594 100644 --- a/rwm.conf.example +++ b/rwm.conf.example @@ -2,8 +2,6 @@ RWM_S3_ENDPOINT_URL: "" RWM_S3_ACCESS_KEY: "" RWM_S3_SECRET_KEY: "" -# RWM_RCLONE - RWM_RCLONE_CRYPT_BUCKET: "rwmcrypt" RWM_RCLONE_CRYPT_PASSWORD: "" diff --git a/rwm.py b/rwm.py index fa69a1e3b5eb036727fdea4d21f98e8b60a9210b..9fa58b267662403751558052866538096e26c2e8 100755 --- a/rwm.py +++ b/rwm.py @@ -153,9 +153,9 @@ def main(argv=None): parser = ArgumentParser(description="restics3 worm manager") parser.add_argument("--config", default="rwm.conf") - 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.add_argument("cmd_args", nargs="*") rc_cmd_parser = subparsers.add_parser("rclone", help="rclone command")