File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,30 @@ if [ -n "$GHE_ALLOW_REPLICA_BACKUP" ]; then
154
154
echo " Warning: backing up a high availability replica may result in inconsistent or unreliable backups."
155
155
fi
156
156
157
+ # Output system information of the backup host
158
+
159
+ # If /etc/issue.net exists, use it to get the OS version
160
+ if [ -f /etc/issue.net ]; then
161
+ echo " Running on: $( cat /etc/issue.net) "
162
+ else
163
+ echo " Running on: Unknown OS"
164
+ fi
165
+
166
+ # If nproc command exists, use it to get the number of CPUs
167
+ if command -v nproc > /dev/null 2>&1 ; then
168
+ echo " CPUs: $( nproc) "
169
+ else
170
+ echo " CPUs: Unknown"
171
+ fi
172
+
173
+ # If the free command exists, use it to get the memory details
174
+ if command -v free > /dev/null 2>&1 ; then
175
+ echo " Memory $( free -m | grep ' ^Mem:' | awk ' {print "total/used/free+share/buff/cache: " $2 "/" $3 "/" $4 "+" $5 "/" $6 "/" $7}' ) "
176
+ else
177
+ echo " Memory: Unknown"
178
+ fi
179
+
180
+
157
181
# Log backup start message in /var/log/syslog on remote instance
158
182
ghe_remote_logger " Starting backup from $( hostname) with backup-utils v$BACKUP_UTILS_VERSION in snapshot $GHE_SNAPSHOT_TIMESTAMP ..."
159
183
Original file line number Diff line number Diff line change @@ -722,3 +722,16 @@ begin_test "ghe-backup fix_paths_for_ghe_version newer/older"
722
722
done
723
723
)
724
724
end_test
725
+
726
+ # Check that information on system where backup-utils is installed is collected
727
+ begin_test " ghe-backup collects information on system where backup-utils is installed"
728
+ (
729
+ set -e
730
+
731
+ output=$( ghe-backup)
732
+ echo " $output " | grep " Running on: $( cat /etc/issue.net) "
733
+ echo " $output " | grep " CPUs: $( nproc) "
734
+ echo " $output " | grep " Memory total/used/free+share/buff/cache:"
735
+
736
+ )
737
+ end_test
You can’t perform that action at this time.
0 commit comments