File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
share/github-backup-utils Expand file tree Collapse file tree 2 files changed +12
-1
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 @@ -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,7 @@ if [ -n "$GHE_EXTRA_RSYNC_OPTS" ]; then
41
48
done
42
49
fi
43
50
44
-
51
+ echo " Running rsync with parameters: ${parameters[*]} "
45
52
ignore_out=' ^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
46
53
rsync_version_check=$( rsync --version | grep -E " version 3.[0-9]*.[0-9]*" )
47
54
if [ -n " $rsync_version_check " ]; then
You can’t perform that action at this time.
0 commit comments