Skip to content

Commit 3a88509

Browse files
committed
Only attempt to restore Pages if we have a backup
1 parent 9b48ddb commit 3a88509

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

libexec/ghe-restore-pages-rsync

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ host="$1"
2222

2323
# Transfer all Pages data from the latest snapshot to the GitHub instance
2424
# in a single rsync invocation.
25-
rsync -avz --delete \
26-
-e "ghe-ssh -p $(ssh_port_part "$host")" \
27-
--rsync-path="sudo -u git rsync" \
28-
"$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/pages/" \
29-
"$(ssh_host_part "$host"):$GHE_REMOTE_DATA_DIR/pages" 1>&3
25+
if [ -d "$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/pages/" ]; then
26+
rsync -avz --delete \
27+
-e "ghe-ssh -p $(ssh_port_part "$host")" \
28+
--rsync-path="sudo -u git rsync" \
29+
"$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/pages/" \
30+
"$(ssh_host_part "$host"):$GHE_REMOTE_DATA_DIR/pages" 1>&3
31+
fi

0 commit comments

Comments
 (0)