Skip to content

Commit 0d4694e

Browse files
committed
Log ghe-backup start/complete on remote instance
1 parent 1d7d241 commit 0d4694e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

bin/ghe-backup

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ echo "Starting backup of $GHE_HOSTNAME in snapshot $GHE_SNAPSHOT_TIMESTAMP"
6767
ghe_remote_version_required
6868
echo "$GHE_REMOTE_VERSION" > version
6969

70+
# Log backup start message in /var/log/syslog on remote instance
71+
ghe_remote_logger "Starting backup from $(hostname) in snapshot $GHE_SNAPSHOT_TIMESTAMP"
72+
7073
# Determine whether to use the rsync or tarball backup strategy based on the
7174
# remote appliance version. The tarball strategy must be used with GitHub
7275
# Enterprise versions prior to 11.10.340 since rsync is not available.
@@ -153,8 +156,11 @@ fi
153156
echo "Completed backup of $GHE_HOSTNAME in snapshot $GHE_SNAPSHOT_TIMESTAMP at $(date +"%H:%M:%S")"
154157

155158
# Exit non-zero and list the steps that failed.
156-
if [ -n "$failures" ]; then
159+
if [ -z "$failures" ]; then
160+
ghe_remote_logger "Completed backup from $(hostname) / snapshot $GHE_SNAPSHOT_TIMESTAMP successfully."
161+
else
157162
steps="$(echo $failures | sed 's/ /, /g')"
163+
ghe_remote_logger "Completed backup from $(hostname) / snapshot $GHE_SNAPSHOT_TIMESTAMP with failures: ${steps}."
158164
echo "Error: Snapshot incomplete. Some steps failed: ${steps}. "
159165
exit 1
160166
fi

0 commit comments

Comments
 (0)