File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ ROOT_DIR=" $ROOT_DIR "
4
+ TOTAL_DIR_TO_COPY=" $TOTAL_DIR_TO_COPY "
5
+ DATA_DIR=" $DATA_DIR "
6
+
7
+ if [ -z " $ROOT_DIR " ] || [ -z " $TOTAL_DIR_TO_COPY " ]; then
8
+ echo " ROOT_DIR and TOTAL_DIR_TO_COPY must be set."
9
+ exit 1
10
+ fi
11
+ Size1=$( du -s " $ROOT_DIR " | cut -f1)
12
+ echo " DATA DIRECTORY SIZE: " , $Size1
13
+ for (( i = 1 ; i <= $TOTAL_DIR_TO_COPY ; i++ )) ; do
14
+ if [[ -d " $ROOT_DIR$i " ]]; then
15
+ Size2=$( du -s " $ROOT_DIR$i " | cut -f1)
16
+ echo $Size1 , " " , $Size2
17
+ if [[ " $Size1 " == " $Size2 " ]]; then
18
+ continue
19
+ fi
20
+ fi
21
+ # not deleting any data
22
+ # because the sole purpose of this script is to copy the data
23
+ # rm -rf "$ROOT_DIR$i"/*
24
+ rm " $ROOT_DIR /mysql.sock"
25
+ cp -rvL " $ROOT_DIR /" * " $ROOT_DIR$i " /
26
+ if [[ $? -ne 0 ]]; then
27
+ echo " Error occurred while copying to $ROOT_DIR$i "
28
+ exit 1
29
+ fi
30
+ done
31
+
32
+ exit 0
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
+ RECOVERY_DONE_FILE=" /tmp/recovery.done"
4
+ if [[ " $PITR_RESTORE " == " true" ]]; then
5
+ while true ; do
6
+ sleep 2
7
+ echo " Point In Time Recovery In Progress. Waiting for $RECOVERY_DONE_FILE file"
8
+ if [[ -e " $RECOVERY_DONE_FILE " ]]; then
9
+ echo " $RECOVERY_DONE_FILE found."
10
+ break
11
+ fi
12
+ done
13
+ fi
14
+
15
+ if [[ -e " $RECOVERY_DONE_FILE " ]]; then
16
+ rm $RECOVERY_DONE_FILE
17
+ fi
18
+
3
19
script_name=${0##*/ }
4
20
5
21
function timestamp() {
You can’t perform that action at this time.
0 commit comments