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