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
6a6cfa4e
Commit
6a6cfa4e
authored
1 year ago
by
Radoslav Bodó
Browse files
Options
Downloads
Patches
Plain Diff
general: config reference documentation
parent
f5c1283d
No related branches found
No related tags found
No related merge requests found
Pipeline
#7684
failed
1 year ago
Stage: code_quality
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+4
-0
4 additions, 0 deletions
README.md
rwm.py
+51
-10
51 additions, 10 deletions
rwm.py
with
55 additions
and
10 deletions
README.md
+
4
−
0
View file @
6a6cfa4e
...
@@ -60,12 +60,16 @@ somewhere - if I only knew.*
...
@@ -60,12 +60,16 @@ somewhere - if I only knew.*
## Usage
## Usage
### Install
### Install
```
```
git clone https://gitlab.cesnet.cz/radoslav_bodo/rwm.git /opt/rwm
git clone https://gitlab.cesnet.cz/radoslav_bodo/rwm.git /opt/rwm
cd /opt/rwm
cd /opt/rwm
make install
make install
```
```
Configuration file uses YAML format, see
`examples/`
for basic use-cases or
`rwm.RWMConfig`
autodoc for full reference.
### RWM: simple backups
### RWM: simple backups
...
...
This diff is collapsed.
Click to expand it.
rwm.py
+
51
−
10
View file @
6a6cfa4e
...
@@ -68,20 +68,32 @@ def size_fmt(num):
...
@@ -68,20 +68,32 @@ def size_fmt(num):
return
f
'
{
num
:
0.1
f
}
YiB
'
return
f
'
{
num
:
0.1
f
}
YiB
'
class
Backup
Config
(
BaseModel
):
class
RWM
Config
(
BaseModel
):
"""
backup
config
model
"""
"""
Main
config
uration for RWM. Configuration file format is YAML.
model_config
=
ConfigDict
(
extra
=
'
forbid
'
)
Attributes:
s3_endpoint_url:
REQUIRED. The endpoint URL for S3.
filesdirs
:
List
[
str
]
s3_access_key:
excludes
:
Optional
[
List
[
str
]]
=
[]
REQUIRED. Access key for S3.
extras
:
Optional
[
List
[
str
]]
=
[]
prerun
:
Optional
[
List
[
str
]]
=
[]
postrun
:
Optional
[
List
[
str
]]
=
[]
s3_secret_key:
REQUIRED. Secret key for S3.
class
RWMConfig
(
BaseModel
):
restic_bucket:
"""
main config model
"""
Bucket for Restic backup repository.
restic_password:
Password for Restic backup repository.
backups:
Dictionary containing named backup configurations.
retention:
Dictionary containing retention policies for Restic repository.
Keys and values corresponds to a `restic forget` command `--keep*` options without leading dashes.
"""
model_config
=
ConfigDict
(
extra
=
'
forbid
'
)
model_config
=
ConfigDict
(
extra
=
'
forbid
'
)
...
@@ -94,6 +106,35 @@ class RWMConfig(BaseModel):
...
@@ -94,6 +106,35 @@ class RWMConfig(BaseModel):
retention
:
Dict
[
str
,
str
]
=
{}
retention
:
Dict
[
str
,
str
]
=
{}
class
BackupConfig
(
BaseModel
):
"""
Configuration for backup operations.
Attributes:
filesdirs:
REQUIRED. List of files and directories to be backed up.
excludes:
List of patterns for `--exclude` options for `restic backup` commmand. Defaults to an empty list.
extras:
Additional options for the `restic backup` commmand. Defaults to an empty list.
prerun:
List of shell commands to execute before backup. Defaults to an empty list.
postrun:
List of shell commands to execute after backup. Defaults to an empty list.
"""
model_config
=
ConfigDict
(
extra
=
'
forbid
'
)
filesdirs
:
List
[
str
]
excludes
:
List
[
str
]
=
[]
extras
:
List
[
str
]
=
[]
prerun
:
List
[
str
]
=
[]
postrun
:
List
[
str
]
=
[]
class
RwmJSONEncoder
(
json
.
JSONEncoder
):
class
RwmJSONEncoder
(
json
.
JSONEncoder
):
"""
json encoder
"""
"""
json encoder
"""
...
...
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