File tree Expand file tree Collapse file tree 9 files changed +18
-9
lines changed
share/github-backup-utils Expand file tree Collapse file tree 9 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ GHE_NUM_SNAPSHOTS=10
58
58
#
59
59
#GHE_EXTRA_RSYNC_OPTS=""
60
60
61
+ # If set to 'yes', rsync will be set to use compression during backups and restores transfers. Defaults to 'no'.
62
+ #
63
+ #GHE_RSYNC_COMPRESSION_ENABLED=yes
64
+
61
65
# If enabled and set to 'no', rsync warning message during backups will be suppressed.
62
66
#RSYNC_WARNING=no
63
67
Original file line number Diff line number Diff line change 39
39
# Transfer all Actions data from the user data directory using rsync.
40
40
ghe_verbose " * Transferring Actions files from $host ..."
41
41
log_rsync " BEGIN: actions rsync" 1>&3
42
- ghe-rsync -avz \
42
+ ghe-rsync -av \
43
43
-e " ghe-ssh -p $port " \
44
44
--rsync-path=' sudo -u actions rsync' \
45
45
--exclude " mutexes" --exclude " dumps" --exclude " tmp" \
Original file line number Diff line number Diff line change 45
45
# already been transferred.
46
46
ghe_verbose " * Performing initial sync of ES indices ..."
47
47
log_rsync " BEGIN elasticsearch rsync" 1>&3
48
- ghe-rsync -avz \
48
+ ghe-rsync -av \
49
49
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
50
50
--rsync-path=" sudo -u elasticsearch rsync" \
51
51
$link_dest \
@@ -70,7 +70,7 @@ ghe-ssh "$host" -- curl -s -XPOST "localhost:9200/_flush" >/dev/null
70
70
# Transfer all ES indices again
71
71
ghe_verbose " * Performing follow-up sync of ES indices ..."
72
72
log_rsync " BEGIN: elasticsearch followup rsync" 1>&3
73
- ghe-rsync -avz \
73
+ ghe-rsync -av \
74
74
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
75
75
--rsync-path=" sudo -u elasticsearch rsync" \
76
76
$link_dest \
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ log_rsync "BEGIN: minio rsync" 1>&3
45
45
ghe-rsync \
46
46
--archive \
47
47
--verbose \
48
- --compress \
49
48
--rsh=" ghe-ssh -p ${port} " \
50
49
--rsync-path=' sudo -u minio rsync' \
51
50
--exclude=" .minio.sys" \
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ for hostname in $hostnames; do
75
75
ghe_verbose " * Transferring pages files ..."
76
76
log_rsync " BEGIN: pages rsync" 1>&3
77
77
# Transfer all data from the user data directory using rsync.
78
- ghe-rsync -avz \
78
+ ghe-rsync -av \
79
79
-e " ssh -q $opts -p $port $ssh_config_file_opt -l $user " \
80
80
--rsync-path=' sudo -u git rsync' \
81
81
$link_dest \
Original file line number Diff line number Diff line change 54
54
mkdir -p " $GHE_SNAPSHOT_DIR /$dirname "
55
55
log_rsync " BEGIN: userdata rsync" 1>&3
56
56
# Transfer all data from the user data directory using rsync.
57
- ghe-rsync -avz \
57
+ ghe-rsync -av \
58
58
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
59
59
--rsync-path=' sudo -u git rsync' \
60
60
$link_dest \
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ if [ -s "$tmp_list" ]; then
51
51
ghe-ssh " $GHE_HOSTNAME " -- " sudo mkdir -p '$GHE_REMOTE_DATA_USER_DIR /elasticsearch-restore'" 1>&3
52
52
ghe-ssh " $GHE_HOSTNAME " -- " sudo chown elasticsearch:elasticsearch '$GHE_REMOTE_DATA_USER_DIR /elasticsearch-restore'" 1>&3
53
53
log_rsync " BEGIN: es-audit log rsync" 1>&3
54
- ghe-rsync -avz --delete \
54
+ ghe-rsync -av --delete \
55
55
-e " ghe-ssh -p $( ssh_port_part " $GHE_HOSTNAME " ) " \
56
56
--rsync-path=" sudo -u elasticsearch rsync" \
57
57
--files-from=$tmp_list \
Original file line number Diff line number Diff line change 37
37
ghe-ssh " $GHE_HOSTNAME " -- " sudo mkdir -p '$GHE_REMOTE_DATA_USER_DIR /elasticsearch-restore'" 1>&3
38
38
ghe-ssh " $GHE_HOSTNAME " -- " sudo chown elasticsearch:elasticsearch '$GHE_REMOTE_DATA_USER_DIR /elasticsearch-restore'" 1>&3
39
39
log_rsync " BEGIN: elasticsearch rsync" 1>&3
40
- ghe-rsync -avz --delete \
40
+ ghe-rsync -av --delete \
41
41
-e " ghe-ssh -p $( ssh_port_part " $GHE_HOSTNAME " ) " \
42
42
--rsync-path=" sudo -u elasticsearch rsync" \
43
43
--copy-dest=" $GHE_REMOTE_DATA_USER_DIR /elasticsearch" \
Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ if [ "$($( dirname "${BASH_SOURCE[0]}" )/ghe-rsync-feature-checker --trust-sende
29
29
parameters=(" --trust-sender" " ${parameters[@]} " )
30
30
fi
31
31
32
+ # This adds `--compress` to the parameters if supported by the current version of rsync
33
+ # shellcheck source=share/github-backup-utils/ghe-rsync-feature-checker
34
+ # shellcheck disable=SC2046
35
+ if [ " $( $( dirname " ${BASH_SOURCE[0]} " ) /ghe-rsync-feature-checker --compress) " == " true" ] && [ " $GHE_RSYNC_COMPRESSION_ENABLED " = " yes" ]; then
36
+ parameters+=(" --compress" )
37
+ fi
38
+
32
39
# This loads the $GHE_EXTRA_RSYNC_OPTS from the config file if available then adds them
33
40
# to the parameters and skip adding if already present in the parameters
34
41
# shellcheck source=share/github-backup-utils/ghe-rsync-feature-checker
@@ -41,7 +48,6 @@ if [ -n "$GHE_EXTRA_RSYNC_OPTS" ]; then
41
48
done
42
49
fi
43
50
44
-
45
51
ignore_out=' ^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
46
52
rsync_version_check=$( rsync --version | grep -E " version 3.[0-9]*.[0-9]*" )
47
53
if [ -n " $rsync_version_check " ]; then
You can’t perform that action at this time.
0 commit comments