Skip to content

Commit c1ce227

Browse files
authored
Merge pull request #582 from github/alejndr0/compression
Disable rsync compression by default.
2 parents 2e968ae + c785db8 commit c1ce227

File tree

9 files changed

+18
-9
lines changed

9 files changed

+18
-9
lines changed

backup.config-example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ GHE_NUM_SNAPSHOTS=10
5858
#
5959
#GHE_EXTRA_RSYNC_OPTS=""
6060

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+
6165
# If enabled and set to 'no', rsync warning message during backups will be suppressed.
6266
#RSYNC_WARNING=no
6367

share/github-backup-utils/ghe-backup-actions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fi
3939
# Transfer all Actions data from the user data directory using rsync.
4040
ghe_verbose "* Transferring Actions files from $host ..."
4141
log_rsync "BEGIN: actions rsync" 1>&3
42-
ghe-rsync -avz \
42+
ghe-rsync -av \
4343
-e "ghe-ssh -p $port" \
4444
--rsync-path='sudo -u actions rsync' \
4545
--exclude "mutexes" --exclude "dumps" --exclude "tmp" \

share/github-backup-utils/ghe-backup-es-rsync

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fi
4545
# already been transferred.
4646
ghe_verbose "* Performing initial sync of ES indices ..."
4747
log_rsync "BEGIN elasticsearch rsync" 1>&3
48-
ghe-rsync -avz \
48+
ghe-rsync -av \
4949
-e "ghe-ssh -p $(ssh_port_part "$host")" \
5050
--rsync-path="sudo -u elasticsearch rsync" \
5151
$link_dest \
@@ -70,7 +70,7 @@ ghe-ssh "$host" -- curl -s -XPOST "localhost:9200/_flush" >/dev/null
7070
# Transfer all ES indices again
7171
ghe_verbose "* Performing follow-up sync of ES indices ..."
7272
log_rsync "BEGIN: elasticsearch followup rsync" 1>&3
73-
ghe-rsync -avz \
73+
ghe-rsync -av \
7474
-e "ghe-ssh -p $(ssh_port_part "$host")" \
7575
--rsync-path="sudo -u elasticsearch rsync" \
7676
$link_dest \

share/github-backup-utils/ghe-backup-minio

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ log_rsync "BEGIN: minio rsync" 1>&3
4545
ghe-rsync \
4646
--archive \
4747
--verbose \
48-
--compress \
4948
--rsh="ghe-ssh -p ${port}" \
5049
--rsync-path='sudo -u minio rsync' \
5150
--exclude=".minio.sys" \

share/github-backup-utils/ghe-backup-pages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ for hostname in $hostnames; do
7575
ghe_verbose "* Transferring pages files ..."
7676
log_rsync "BEGIN: pages rsync" 1>&3
7777
# Transfer all data from the user data directory using rsync.
78-
ghe-rsync -avz \
78+
ghe-rsync -av \
7979
-e "ssh -q $opts -p $port $ssh_config_file_opt -l $user" \
8080
--rsync-path='sudo -u git rsync' \
8181
$link_dest \

share/github-backup-utils/ghe-backup-userdata

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fi
5454
mkdir -p "$GHE_SNAPSHOT_DIR/$dirname"
5555
log_rsync "BEGIN: userdata rsync" 1>&3
5656
# Transfer all data from the user data directory using rsync.
57-
ghe-rsync -avz \
57+
ghe-rsync -av \
5858
-e "ghe-ssh -p $(ssh_port_part "$host")" \
5959
--rsync-path='sudo -u git rsync' \
6060
$link_dest \

share/github-backup-utils/ghe-restore-es-audit-log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ -s "$tmp_list" ]; then
5151
ghe-ssh "$GHE_HOSTNAME" -- "sudo mkdir -p '$GHE_REMOTE_DATA_USER_DIR/elasticsearch-restore'" 1>&3
5252
ghe-ssh "$GHE_HOSTNAME" -- "sudo chown elasticsearch:elasticsearch '$GHE_REMOTE_DATA_USER_DIR/elasticsearch-restore'" 1>&3
5353
log_rsync "BEGIN: es-audit log rsync" 1>&3
54-
ghe-rsync -avz --delete \
54+
ghe-rsync -av --delete \
5555
-e "ghe-ssh -p $(ssh_port_part "$GHE_HOSTNAME")" \
5656
--rsync-path="sudo -u elasticsearch rsync" \
5757
--files-from=$tmp_list \

share/github-backup-utils/ghe-restore-es-rsync

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ else
3737
ghe-ssh "$GHE_HOSTNAME" -- "sudo mkdir -p '$GHE_REMOTE_DATA_USER_DIR/elasticsearch-restore'" 1>&3
3838
ghe-ssh "$GHE_HOSTNAME" -- "sudo chown elasticsearch:elasticsearch '$GHE_REMOTE_DATA_USER_DIR/elasticsearch-restore'" 1>&3
3939
log_rsync "BEGIN: elasticsearch rsync" 1>&3
40-
ghe-rsync -avz --delete \
40+
ghe-rsync -av --delete \
4141
-e "ghe-ssh -p $(ssh_port_part "$GHE_HOSTNAME")" \
4242
--rsync-path="sudo -u elasticsearch rsync" \
4343
--copy-dest="$GHE_REMOTE_DATA_USER_DIR/elasticsearch" \

share/github-backup-utils/ghe-rsync

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ if [ "$($( dirname "${BASH_SOURCE[0]}" )/ghe-rsync-feature-checker --trust-sende
2929
parameters=("--trust-sender" "${parameters[@]}")
3030
fi
3131

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+
3239
# This loads the $GHE_EXTRA_RSYNC_OPTS from the config file if available then adds them
3340
# to the parameters and skip adding if already present in the parameters
3441
# shellcheck source=share/github-backup-utils/ghe-rsync-feature-checker
@@ -41,7 +48,6 @@ if [ -n "$GHE_EXTRA_RSYNC_OPTS" ]; then
4148
done
4249
fi
4350

44-
4551
ignore_out='^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
4652
rsync_version_check=$(rsync --version | grep -E "version 3.[0-9]*.[0-9]*")
4753
if [ -n "$rsync_version_check" ]; then

0 commit comments

Comments
 (0)