Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
bdfcca51
Commit
bdfcca51
authored
Apr 23, 2018
by
tong.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4.96
parent
3ac224c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
daily_db_backup.sh
db-utils/daily_db_backup.sh
+4
-3
db_gen_config.sh
db-utils/db_gen_config.sh
+3
-2
db_schema_sync.sh
db-utils/db_schema_sync.sh
+2
-2
4.2_rm_db_backup_file.sh
qa_shell_script/cron/4.2_rm_db_backup_file.sh
+2
-2
No files found.
db-utils/daily_db_backup.sh
View file @
bdfcca51
...
...
@@ -2,8 +2,8 @@
set
-u
source
~/.profile
work_dir
=
/home/qa-deploy-utils/db-utils
sync_config_folder
=
/home/db_sync_configs
db_backup_folder
=
/home/daily_db_backup
sync_config_folder
=
/home/
quant_group/
db_sync_configs
db_backup_folder
=
/home/
quant_group/
daily_db_backup
source_db_host
=
$1
source_db_user
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/xyqb/username
`
...
...
@@ -26,6 +26,7 @@ function db_schema_sync()
echo
"mkdir -p
$db_backup_sub_folders
"
mkdir
-p
$db_backup_sub_folders
mkdir
-p
$sync_config_folder
echo
"--- Step 1: generate_config_file:
$config_file_name
---"
# echo "source infos: $source_db_host $source_db_user"
...
...
@@ -55,4 +56,4 @@ do
db_schema_sync
$db_name
echo
"--- end sync
$db_name
---"
done
echo
"----------------------------------------------------"
\ No newline at end of file
echo
"----------------------------------------------------"
db-utils/db_gen_config.sh
View file @
bdfcca51
...
...
@@ -23,13 +23,14 @@ config_file_name=$8
db_backup_sub_folders
=
$9
use_cache
=
${
10
}
target_db_port
=
${
11
}
mkdir
-p
db_backup_sub_folders
port
=
""
sys_table_list
=
""
sync_config_folder
=
~/db_sync_configs
base_config_file
=
$work_dir
/config/base_config.json
cache_dir
=
/home/daily_db_backup
cache_dir
=
/home/
quant_group/
daily_db_backup
# if [ $# -ne 9 ]; then
# echo "db_gen_config.sh"
...
...
@@ -224,4 +225,4 @@ fi
# source_db_pwd=`curl -s http://192.168.4.3:10088/config_server/get_db_config/$database_name/pwd`
# sys_table_list=`curl -s http://192.168.4.3:10088/config_server/get_db_config/$database_name/sys_table_list`
# source_db_host=`curl -s http://192.168.4.3:10088/config_server/get_db_config/$database_name/host`
# port=`curl -s http://192.168.4.3:10088/config_server/get_db_config/$database_name/port`
\ No newline at end of file
# port=`curl -s http://192.168.4.3:10088/config_server/get_db_config/$database_name/port`
db-utils/db_schema_sync.sh
View file @
bdfcca51
...
...
@@ -26,8 +26,8 @@ if [ $# -ne 11 ]; then
fi
work_dir
=
/home/qa-deploy-utils/db-utils
sync_config_folder
=
/home/db_sync_configs
db_backup_folder
=
/home/db_backups
sync_config_folder
=
/home/
quant_group/
db_sync_configs
db_backup_folder
=
/home/
quant_group/
db_backups
source_db_host
=
$1
source_db_user
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/xyqb/username
`
...
...
qa_shell_script/cron/4.2_rm_db_backup_file.sh
View file @
bdfcca51
find /home/db_sync_configs/
*
-ctime
0.3
-exec
rm
-rf
{}
\;
find /home/db_backups/
*
-ctime
0.3
-exec
rm
-rf
{}
\;
\ No newline at end of file
find /home/quant_group/db_sync_configs/
*
-ctime
0.3
-exec
rm
-rf
{}
\;
find /home/quant_group/db_backups/
*
-ctime
0.3
-exec
rm
-rf
{}
\;
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