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