Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mysql-backup-s3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
mysql-backup-s3
Commits
07409fb0
Commit
07409fb0
authored
Jul 11, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use zstd
parent
c1145d4c
Pipeline
#14495
passed with stages
in 11 minutes and 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
backup.sh
backup.sh
+8
-8
install.sh
install.sh
+1
-1
No files found.
backup.sh
View file @
07409fb0
...
@@ -71,15 +71,15 @@ if [ ! -z "$(echo $MULTI_FILES | grep -i -E "(yes|true|1)")" ]; then
...
@@ -71,15 +71,15 @@ if [ ! -z "$(echo $MULTI_FILES | grep -i -E "(yes|true|1)")" ]; then
for
DB
in
$DATABASES
;
do
for
DB
in
$DATABASES
;
do
echo
"Creating individual dump of
${
DB
}
from
${
MYSQL_HOST
}
..."
echo
"Creating individual dump of
${
DB
}
from
${
MYSQL_HOST
}
..."
DUMP_FILE
=
"/tmp/
${
DB
}
.sql.
gz
"
DUMP_FILE
=
"/tmp/
${
DB
}
.sql.
zst
"
mysqldump
$MYSQL_HOST_OPTS
$MYSQLDUMP_OPTIONS
--databases
$DB
|
gzip
>
$DUMP_FILE
mysqldump
$MYSQL_HOST_OPTS
$MYSQLDUMP_OPTIONS
--databases
$DB
|
zstd
>
$DUMP_FILE
if
[
$?
==
0
]
;
then
if
[
$?
==
0
]
;
then
if
[
"
${
S3_FILENAME
}
"
==
"**None**"
]
;
then
if
[
"
${
S3_FILENAME
}
"
==
"**None**"
]
;
then
S3_FILE
=
"
${
DUMP_START_TIME
}
.
${
DB
}
.sql.
gz
"
S3_FILE
=
"
${
DUMP_START_TIME
}
.
${
DB
}
.sql.
zst
"
else
else
S3_FILE
=
"
${
S3_FILENAME
}
.
${
DB
}
.sql.
gz
"
S3_FILE
=
"
${
S3_FILENAME
}
.
${
DB
}
.sql.
zst
"
fi
fi
copy_s3
$DUMP_FILE
$S3_FILE
copy_s3
$DUMP_FILE
$S3_FILE
...
@@ -91,14 +91,14 @@ if [ ! -z "$(echo $MULTI_FILES | grep -i -E "(yes|true|1)")" ]; then
...
@@ -91,14 +91,14 @@ if [ ! -z "$(echo $MULTI_FILES | grep -i -E "(yes|true|1)")" ]; then
else
else
echo
"Creating dump for
${
MYSQLDUMP_DATABASE
}
from
${
MYSQL_HOST
}
..."
echo
"Creating dump for
${
MYSQLDUMP_DATABASE
}
from
${
MYSQL_HOST
}
..."
DUMP_FILE
=
"/tmp/dump.sql.
gz
"
DUMP_FILE
=
"/tmp/dump.sql.
zst
"
mysqldump
$MYSQL_HOST_OPTS
$MYSQLDUMP_OPTIONS
$MYSQLDUMP_DATABASE
|
gzip
>
$DUMP_FILE
mysqldump
$MYSQL_HOST_OPTS
$MYSQLDUMP_OPTIONS
$MYSQLDUMP_DATABASE
|
zstd
>
$DUMP_FILE
if
[
$?
==
0
]
;
then
if
[
$?
==
0
]
;
then
if
[
"
${
S3_FILENAME
}
"
==
"**None**"
]
;
then
if
[
"
${
S3_FILENAME
}
"
==
"**None**"
]
;
then
S3_FILE
=
"
${
DUMP_START_TIME
}
.dump.sql.
gz
"
S3_FILE
=
"
${
DUMP_START_TIME
}
.dump.sql.
zst
"
else
else
S3_FILE
=
"
${
S3_FILENAME
}
.sql.
gz
"
S3_FILE
=
"
${
S3_FILENAME
}
.sql.
zst
"
fi
fi
copy_s3
$DUMP_FILE
$S3_FILE
copy_s3
$DUMP_FILE
$S3_FILE
...
...
install.sh
View file @
07409fb0
...
@@ -8,7 +8,7 @@ apk update
...
@@ -8,7 +8,7 @@ apk update
apk add mysql-client python3 py3-pip tzdata
apk add mysql-client python3 py3-pip tzdata
zstd
cp
-rf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cp
-rf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo
"Asia/Shanghai"
>
/etc/timezone
echo
"Asia/Shanghai"
>
/etc/timezone
...
...
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