-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreDatabaseSync.sh
More file actions
executable file
·40 lines (34 loc) · 981 Bytes
/
preDatabaseSync.sh
File metadata and controls
executable file
·40 lines (34 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
function print_usage_and_exit() {
echo "Usage: ${0} [-h] -d"
echo
echo "This script is part of the sync process,"
echo "it will execute the scripts generateDropTablesQueries.sh and generateStuffFromDestination.sh"
echo
echo "Available options:"
echo
echo "-h|--help print this help text and exit"
echo "-d|--database-name the name of the database from the destination system"
echo "-l|--local_dump_dir the directory in which the dump from the source database lies"
echo
exit 0
}
[[ "$#" -lt 1 ]] && print_usage_and_exit
while [[ $# -ge 1 ]]; do
case "$1" in
-d | --database-name)
database_name="$2"
shift
;;
-l | --local-dump-dir)
local_dump_dir="$2"
shift
;;
-h | --help)
print_usage_and_exit
;;
esac
shift
done
./generateDropTablesQueries.sh -d ${database_name} -l ${local_dump_dir}
./generatePostImportFiles.sh -d ${database_name} -l ${local_dump_dir}