Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rwm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radoslav Bodó
rwm
Commits
b2c07507
Commit
b2c07507
authored
1 year ago
by
Radoslav Bodó
Browse files
Options
Downloads
Patches
Plain Diff
general: cleanup and documentation
parent
a337a5c0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+39
-8
39 additions, 8 deletions
README.md
rwm.conf.example
+0
-2
0 additions, 2 deletions
rwm.conf.example
rwm.py
+2
-2
2 additions, 2 deletions
rwm.py
with
41 additions
and
12 deletions
README.md
+
39
−
8
View file @
b2c07507
...
@@ -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
```
```
...
...
This diff is collapsed.
Click to expand it.
rwm.conf.example
+
0
−
2
View file @
b2c07507
...
@@ -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: ""
...
...
This diff is collapsed.
Click to expand it.
rwm.py
+
2
−
2
View file @
b2c07507
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment