aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBruno Cesar Ribas <brunoribas@gmail.com>2018-08-28 00:31:07 +0000
committerBruno Cesar Ribas <brunoribas@gmail.com>2018-08-28 00:31:07 +0000
commit1b06668b95d393ba366b3568e555258a4706c90d (patch)
treeb902a39d8651aa2ad0f80a3b2676324c4d327608 /tools
parent478d17d38297b87c1336d0a6004b4013549cbcc1 (diff)
parent78e178aaf018c36c4eda6b4231f9a4eb5e4e997a (diff)
downloadboca-1b06668b95d393ba366b3568e555258a4706c90d.tar.gz
boca-1b06668b95d393ba366b3568e555258a4706c90d.zip
Merge remote-tracking branch 'origin/develc' into devel
Diffstat (limited to 'tools')
-rw-r--r--tools/boca-submit-log21
-rw-r--r--tools/cron-boca-log2
2 files changed, 15 insertions, 8 deletions
diff --git a/tools/boca-submit-log b/tools/boca-submit-log
index 286e5f6..d9cffa8 100644
--- a/tools/boca-submit-log
+++ b/tools/boca-submit-log
@@ -15,29 +15,33 @@ if [ "$BOCASERVER" == "" ]; then
exit 1
fi
-for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
+for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
- grep -e sudo -e "password:session" /var/log/auth.log | tail -n 100 > /root/.logsession.tmp
+ grep -e sudo -e "password:session" /var/log/auth.log | tail -n 500 > /root/.logsession.tmp
[ -f /root/.logsession ] || touch /root/.logsession
diff /root/.logsession /root/.logsession.tmp > /root/.logsession.diff 2>/dev/null
res=$?
- journalctl | grep -i mount | grep -i -e "filesystem" -e "file system" | tail -n 100 > /root/.logfs.tmp
+ journalctl | grep -i mount | tail -n 500 > /root/.logfs.tmp
[ -f /root/.logfs ] || touch /root/.logfs
diff /root/.logfs /root/.logfs.tmp > /root/.logfs.diff 2>/dev/null
resfs=$?
+ grep -i mount /var/log/kern.log | grep -i -e "filesystem" -e "file system" | tail -n 500 > /root/.logkfs.tmp
+ [ -f /root/.logkfs ] || touch /root/.logkfs
+ diff /root/.logkfs /root/.logkfs.tmp > /root/.logkfs.diff 2>/dev/null
+ reskfs=$?
if [ "$zcount" == "1" ]; then
- tail -n 1000 /var/log/logkeys.log > /root/.logkeys.tmp
+ tail -n 10000 /var/log/logkeys.log > /root/.logkeys.tmp
[ -f /root/.logkeys ] || touch /root/.logkeys
diff /root/.logkeys /root/.logkeys.tmp > /root/.logkeys.diff 2>/dev/null
reskeys=$?
else
- echo "" > /root/.logkeys.diff
+ echo -n "" > /root/.logkeys.diff
reskeys=0
fi
- if [ "$res" != "0" -o "$resfs" != "0" -o "$reskey" != "0" ]; then
+ if [ "$res" != "0" -o "$resfs" != "0" -o "$reskfs" != "0" -o "$reskeys" != "0" ]; then
for i in uuencode wget tr perl sha256sum cut; do
p=`which $i`
if [ -x "$p" ]; then
@@ -61,6 +65,8 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
grep "^>" /root/.logsession.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp
echo -n "&logfs=" >> $temp
grep "^>" /root/.logfs.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp
+ echo -n "&logkfs=" >> $temp
+ grep "^>" /root/.logkfs.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp
echo -n "&logkeys=" >> $temp
grep "^>" /root/.logkeys.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp
@@ -82,7 +88,8 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
[ -f /root/.logsession.tmp ] && mv /root/.logsession.tmp /root/.logsession
[ -f /root/.logkeys.tmp ] && mv /root/.logkeys.tmp /root/.logkeys
[ -f /root/.logfs.tmp ] && mv /root/.logfs.tmp /root/.logfs
- [ "$zcount" == "16" ] || sleep 10
+ [ -f /root/.logkfs.tmp ] && mv /root/.logkfs.tmp /root/.logkfs
+ [ "$zcount" == "15" ] || sleep 10
done
exit 0
diff --git a/tools/cron-boca-log b/tools/cron-boca-log
index 4fa18cf..c5aedcf 100644
--- a/tools/cron-boca-log
+++ b/tools/cron-boca-log
@@ -1 +1 @@
-* * * * * root /usr/sbin/boca-submit-log >>/var/log/boca-submit-log.out 2>>/var/log/boca-submit-log.err
+*/3 * * * * root /usr/sbin/boca-submit-log >>/var/log/boca-submit-log.out 2>>/var/log/boca-submit-log.err