Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
5c3deb64
Commit
5c3deb64
authored
Jul 30, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5: exclude mysql database from mysqldump backups
parent
09f76ebf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
software/erp5/test/test/test_mariadb.py
software/erp5/test/test/test_mariadb.py
+32
-0
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+1
-1
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+1
-1
No files found.
software/erp5/test/test/test_mariadb.py
View file @
5c3deb64
...
...
@@ -34,6 +34,7 @@ import socket
import
time
import
contextlib
import
datetime
import
subprocess
import
MySQLdb
...
...
@@ -86,6 +87,37 @@ class MariaDBTestCase(ERP5InstanceTestCase):
)
class
TestCrontabs
(
MariaDBTestCase
):
def
_getCrontabCommand
(
self
,
crontab_name
):
"""Read a crontab and return the command that is executed.
"""
with
open
(
os
.
path
.
join
(
self
.
computer_partition_root_path
,
'etc'
,
'cron.d'
,
crontab_name
,
))
as
f
:
crontab_spec
=
f
.
read
()
return
" "
.
join
(
crontab_spec
.
split
()[
5
:])
def
test_full_backup
(
self
):
subprocess
.
check_call
(
self
.
_getCrontabCommand
(
'mariadb-backup'
),
shell
=
True
,
)
self
.
assertTrue
(
glob
.
glob
(
os
.
path
.
join
(
self
.
computer_partition_root_path
,
'srv'
,
'backup'
,
'mariadb-full'
,
'*gz'
,
)))
class
TestMariaDB
(
MariaDBTestCase
):
def
test_utf8_collation
(
self
):
cnx
=
self
.
getDatabaseConnection
()
...
...
stack/erp5/buildout.hash.cfg
View file @
5c3deb64
...
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum =
bfed6ac56c3ba0e96be4c9474dac6f20
md5sum =
1236505acbc989c9e9a8242b0a86f6fd
[template-kumofs]
filename = instance-kumofs.cfg.in
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
5c3deb64
...
...
@@ -107,7 +107,7 @@ time = {{ dumps(backup_periodicity) }}
# can be fully restored.
# master-data: use value "2" as we are not in a replication case
#}
command = "${binary-wrap-mysqldump:wrapper-path}" --all-databases --flush-privileges --single-transaction --max-allowed-packet=128M {% if incremental_backup_retention_days > -1 %}--flush-logs --master-data=2 {% endif %}| {{ parameter_dict['gzip-location'] }}/bin/gzip > "${directory:mariadb-backup-full}/$({{ parameter_dict['coreutils-location'] }}/bin/date "+%Y%m%d%H%M%S").sql.gz"
command = "${binary-wrap-mysqldump:wrapper-path}" --all-databases --
error-exclude-database=mysql --
flush-privileges --single-transaction --max-allowed-packet=128M {% if incremental_backup_retention_days > -1 %}--flush-logs --master-data=2 {% endif %}| {{ parameter_dict['gzip-location'] }}/bin/gzip > "${directory:mariadb-backup-full}/$({{ parameter_dict['coreutils-location'] }}/bin/date "+%Y%m%d%H%M%S").sql.gz"
{# KEEP GLOB PATTERN IN SYNC with generated filenames above
# YYYYmmddHHMMSS -#}
file-glob = ??????????????.sql.gz
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment