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
7b420502
Commit
7b420502
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
mysqldump params can be customized in jobs/env
parent
3c73cc0d
No related branches found
No related tags found
1 merge request
!117
mysqldump params can be customized in jobs/env
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
jobhelper.sh
+2
-0
2 additions, 0 deletions
jobhelper.sh
jobs/env_defaults
+21
-0
21 additions, 0 deletions
jobs/env_defaults
plugins/localdump/mysql.sh
+5
-7
5 additions, 7 deletions
plugins/localdump/mysql.sh
with
28 additions
and
7 deletions
jobhelper.sh
+
2
−
0
View file @
7b420502
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# 2022-10-07 ah v1.4 unescape regex with space to prevent "grep: warning: stray \ before white space"
# 2022-10-07 ah v1.4 unescape regex with space to prevent "grep: warning: stray \ before white space"
# 2023-03-17 ah v1.5 ignore required user on MS windows; source jobs/env if it exists; use varaiable FQDN
# 2023-03-17 ah v1.5 ignore required user on MS windows; source jobs/env if it exists; use varaiable FQDN
# 2023-04-12 ah v1.6 add desktop notification
# 2023-04-12 ah v1.6 add desktop notification
# 2023-10-06 v1.7 source jobs/env_defaults
# ================================================================================
# ================================================================================
...
@@ -43,6 +44,7 @@ STORAGEFILE="${DIR_JOBS}/transfer.job"
...
@@ -43,6 +44,7 @@ STORAGEFILE="${DIR_JOBS}/transfer.job"
function
j_init
(){
function
j_init
(){
j_banner
j_banner
.
"
${
DIR_JOBS
}
/env_defaults"
if
[
-r
"
${
DIR_JOBS
}
/env"
]
;
if
[
-r
"
${
DIR_JOBS
}
/env"
]
;
then
then
echo
"INFO: loading custom environment
${
DIR_JOBS
}
/env"
echo
"INFO: loading custom environment
${
DIR_JOBS
}
/env"
...
...
This diff is collapsed.
Click to expand it.
jobs/env_defaults
0 → 100644
+
21
−
0
View file @
7b420502
#!/bin/bash
# ----------------------------------------------------------------------
#
# DEFAULTS !!! Do not edit this file !!!
# Overide customizations in file "env" (maybe copy env.dist to env first)
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Localdump
# ----------------------------------------------------------------------
# mysql
LD_MYSQL_DUMP_PARAMS
=
"--opt
\
--default-character-set=utf8
\
--flush-logs
\
--single-transaction
\
--no-autocommit
\
"
# ----------------------------------------------------------------------
\ No newline at end of file
This diff is collapsed.
Click to expand it.
plugins/localdump/mysql.sh
+
5
−
7
View file @
7b420502
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# 2022-03-17 v2.2 WIP: add lines with prefix __DB__
# 2022-03-17 v2.2 WIP: add lines with prefix __DB__
# 2022-03-21 v2.3 Check if the created dump contains "insert"
# 2022-03-21 v2.3 Check if the created dump contains "insert"
# 2022-03-24 v2.4 On empty dumps: detect if source db is empty too
# 2022-03-24 v2.4 On empty dumps: detect if source db is empty too
# 2023-10-06 v2.5 mysqldump params can be customized in jobs/env
# ================================================================================
# ================================================================================
if
[
-z
"
$LOCALDUMP_LOADED
"
]
;
then
if
[
-z
"
$LOCALDUMP_LOADED
"
]
;
then
...
@@ -78,6 +79,9 @@ function mysql.db.create(){
...
@@ -78,6 +79,9 @@ function mysql.db.create(){
# dump [database] --> [file]
# dump [database] --> [file]
# dump a single database into given file
# dump a single database into given file
#
# global LD_MYSQL_DUMP_PARAMS string parameters from file jobs/env_defaults
#
# param string name of database to dump
# param string name of database to dump
# param string name of output file
# param string name of output file
function
mysql.db.dump
(){
function
mysql.db.dump
(){
...
@@ -85,13 +89,7 @@ function mysql.db.dump(){
...
@@ -85,13 +89,7 @@ function mysql.db.dump(){
local
_dbname
=
$1
local
_dbname
=
$1
local
_dumpfile
=
$2
local
_dumpfile
=
$2
mysqldump
--opt
\
mysqldump
$LD_MYSQL_DUMP_PARAMS
--result-file
=
"
$_dumpfile
"
"
$_dbname
"
2>&1
--default-character-set
=
utf8
\
--flush-logs
\
--single-transaction
\
--no-autocommit
\
--result-file
=
"
$_dumpfile
"
\
"
$_dbname
"
2>&1
fetchrc
>
/dev/null
fetchrc
>
/dev/null
if
[
$myrc
-eq
0
]
;
then
if
[
$myrc
-eq
0
]
;
then
...
...
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