init: Changes logs for feedback from base.ext.# to base.#.ext
The user feedback was missing net.log files beyond the base name because
the iteration number was embedded in the logfile name. This change will
now pickup all of net.#.log.
BUG=chromium:218987
TEST=manual:
- edit /var/log/net.log
- cut all but, say, the last 3 lines
- edit /var/log/net.1.log
- paste the stuff from net.log
- modify the last line of net.1.log to contain 'frumpty' (make sure
the date and time are intact)
- file feedback
- check out the feedback report on:
https://feedback.corp.google.com/#/Product/208/Reports
- look at Product Specific Binary Data
- make sure 'frumpty' is found in the report in the 'system_logs.zip'
file
Change-Id: I3d6488fad11a2376ea5186178e9a41d4db097f7e
Reviewed-on: https://gerrit.chromium.org/gerrit/57832
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
diff --git a/scripts/getmsgs b/scripts/getmsgs
index 6c115c8..2dc7306 100755
--- a/scripts/getmsgs
+++ b/scripts/getmsgs
@@ -8,7 +8,7 @@
# stdout according to a time specification. By default the last day of
# msgs written to /var/log/messages is printed. Options:
# --last <time> collect most recent msgs up to <time> (default 1 day)
-# --bytes N cap collected data at N bytes (default 80K)
+# --bytes N cap collected data at N bytes (default 130K)
#
# Note option order is important (TODO(sleffler) rewrite w/ shflags)
@@ -28,10 +28,17 @@
# create list of files assuming normal log rotation
LOGFILES="${LOGFILE}"
+local BASENAME="${LOGFILE%%.*}"
+local EXTENSION="${LOGFILE#*.}"
+if [ "${BASENAME}" = "${EXTENSION}" ]; then
+ EXTENSION=""
+else
+ EXTENSION=".${EXTENSION}"
+fi
for i in 1 2 3 4 5 6 7 8 9; do
- file="${LOGFILE}".$i
- [ -f "$file" ] || break
- LOGFILES="${LOGFILES} $file"
+ FILE="${BASENAME}".$i${EXTENSION}
+ [ -f "$FILE" ] || break
+ LOGFILES="${LOGFILES} $FILE"
done
WHEN="now - $LAST"