Skip to content

Commit f336730

Browse files
authored
Merge pull request #343 from github/rsync_warn_msg
Warn users if they use certain versions of rsync
2 parents 9ab9dd3 + 24d91b9 commit f336730

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

backup.config-example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ GHE_NUM_SNAPSHOTS=10
4242
#
4343
#GHE_EXTRA_RSYNC_OPTS=""
4444

45+
# If enabled and set to 'no', rsync warning message during backups will be suppressed.
46+
#RSYNC_WARNING=no
47+
4548

4649
# If set to 'yes', logging output will be colorized.
4750
#
@@ -97,4 +100,4 @@ GHE_NUM_SNAPSHOTS=10
97100
#EXTERNAL_DATABASE_RESTORE_SCRIPT="/bin/false"
98101

99102
# If set to 'yes', Pages data will be included in backup and restore. Defaults to 'yes'
100-
#GHE_BACKUP_PAGES=no
103+
#GHE_BACKUP_PAGES=no

bin/ghe-host-check

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,17 @@ DATA_TRANSFER_SIZE
213213
echo "rsync version $rsync_version in backup-host does not meet minimum requirements." 1>&2
214214
echo "Please make sure you have the minimum required version of rsync: $min_rsync installed" 1>&2
215215
exit 1
216-
else
217-
echo "rsync ${rsync_version} >= required ($min_rsync)" 1>&2
216+
elif [[ $rsync_version < 3.2.5 ]] && [[ $RSYNC_WARNING != "no" ]]; then
217+
cat << WARN_MSG 1>&2
218+
**WARNING:** rsync version $rsync_version on backup host is less than 3.2.5, which could result in performance degradation.
219+
220+
For more details, please read documentation at https://github.com/github/backup-utils/blob/master/docs/requirements.md#april-2023-update-of-rsync-requirements
221+
222+
You can disable this warning by changing RSYNC_WARNING to 'no' in your backup.config file.
223+
224+
WARN_MSG
218225
fi
226+
echo "rsync ${rsync_version} >= required ($min_rsync)" 1>&2
219227

220228
ssh_version=$(ssh -V 2>&1 | awk '{print $1}'|grep -oPm 1 '[\d\.]+' |head -1 | tr -cd '[:digit:].\n')
221229
if awk "BEGIN {exit !($ssh_version < $min_openssh)}" &> /dev/null; then

0 commit comments

Comments
 (0)