Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
bbc8bb6b
Commit
bbc8bb6b
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add readme for profiles
parent
1008ddf9
No related branches found
No related tags found
1 merge request
!129
Db Profiles
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/localdump/profiles/readme.md
+83
-0
83 additions, 0 deletions
plugins/localdump/profiles/readme.md
with
83 additions
and
0 deletions
plugins/localdump/profiles/readme.md
0 → 100644
+
83
−
0
View file @
bbc8bb6b
# Database profiles
## Introduction
In this folder are several ini files.
They describe a database environment by the [detect] section. If a profile matches then a database will be dumped or restored.
## File names
File convention:
`<DBTYPE>_<PROFILE>.ini`
*
<DBTYPE>
must match a database dumper in plugins/localdump/ without extension ".sh"
*
<DBTYPE>
_
<PROFILE>
is the target folder to store backups.
*
<PROFILE>
is a custom name to
*
_
<PROFILE>
can be empty to mark a local database of the given type.
## Detect
To detect the existance of you can use the following keys. If all found detect entries match it is counted as detected.
| Key | Type | Description |
|--- |--- |--- |
| file[] | string | full path of a file. It must match "type". It can be given multiple times.
| process | regex | A binary to be matched in the process list
| tcp | integer | A tcp port number that must match
| tcp-process | regex | A process name offering the local tcp port (regex for last column in netstat -tulpen)
| tcp-target | string | A hostname for tcp port check, eg localhost
| type | regex | a matching regex for file -b FILE | grep -i REGEX; see "file[]"
Example:
Mysql detection in a docker container:
```
ini
[detect]
process
=
'mysqld|mariadb'
tcp
=
13306
tcp-target
=
localhost
tcp-process
=
'rootlesskit'
```
Multiple Sqlite files
```
ini
[detect]
file
[]
=
"/home/axel/data/docker/ciserver/data/imldeployment/data/database/logs.db"
file
[]
=
"/home/axel/data/docker/ciserver/public_html/valuestore/data/versioncache.db"
type
=
"sqlite"
```
## Setter
If a profile detection was successful then values in the [set] section will be applied.
| Key | Type | Description |
|--- |--- |--- |
| su | string | User for su command; used for postgres
| dbuser | string | Database user; for replacement
| dbpassword | string | Password of database user; for replacement
| params | string | cli paramaters für dump / restore tools.
| env | string | extend environment with some variables, eg. export var1="something here". After backup/ restore this variables will be unset
Replacements that can be used for values
`params`
and
`env`
:
| Key | Description |
|--- |--- |
| {{tcp}} | value of [detect] -> tcp
| {{dbpassword}} | value of [set] -> dbpassword
| {{dbuser}} | value of [set] -> dbuser
| {{tcp-target}} | value of [detect] -> tcp-target
```
ini
[set]
su
=
''
dbuser
=
'root'
dbpassword
=
'12345678'
params
=
'--port={{tcp}} --password={{dbpassword}} --user={{dbuser}} --host={{tcp-target}}'
env
=
'export var1="happy meal"; export var2="new"; export var3="year!"'
```
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