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
4e315830
Commit
4e315830
authored
1 year ago
by
Radoslav Bodó
Browse files
Options
Downloads
Patches
Plain Diff
general: update docs
parent
2644e4d8
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
+65
-23
65 additions, 23 deletions
README.md
rwm.conf.example
+2
-2
2 additions, 2 deletions
rwm.conf.example
rwm.py
+2
-2
2 additions, 2 deletions
rwm.py
with
69 additions
and
27 deletions
README.md
+
65
−
23
View file @
4e315830
...
...
@@ -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
```
##
s
imple copy: rclone with crypt overlay
##
# S
imple 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
...
...
This diff is collapsed.
Click to expand it.
rwm.conf.example
+
2
−
2
View file @
4e315830
...
...
@@ -12,5 +12,5 @@ rwm_restic_bucket: "rwmcrypt"
rwm_restic_password: ""
# backup
rwm_backups:
[]
rwm_retention:
[]
rwm_backups:
{}
rwm_retention:
{}
This diff is collapsed.
Click to expand it.
rwm.py
+
2
−
2
View file @
4e315830
...
...
@@ -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
)
...
...
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