Skip to content

Commit b3581bd

Browse files
committed
Tell rsync to preserve hard links for git objects/packs directories
Without -H option the rsync will sync the files that are hardlinked on the source side as separate files on receiver side. In some situations this might make it impossible to restore appliance from backup as restored repository filesystem contents can be several times bigger than original contents used to create backup.
1 parent b3bbcca commit b3581bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libexec/ghe-backup-repositories-rsync

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ RULES
152152
# since these files are already well compressed.
153153
echo 1>&3
154154
echo "* Transferring objects and packs ..." 1>&3
155-
rsync_repository_data <<RULES
155+
rsync_repository_data -H <<RULES
156156
- /__*__/
157157
+ /*/
158158
+ /*/*.git

libexec/ghe-restore-repositories-rsync

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ host="$1"
2222

2323
# Transfer all git repository data from the latest snapshot to the GitHub
2424
# instance in a single rsync invocation.
25-
ghe-rsync -av --delete \
25+
ghe-rsync -avH --delete \
2626
-e "ghe-ssh -p $(ssh_port_part "$host")" \
2727
--rsync-path="sudo -u git rsync" \
2828
"$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/repositories/" \

0 commit comments

Comments
 (0)