Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: edit.sh

Issue 29761555: #8852 - ldap sync output filter (Closed)
Patch Set: #8852 - ldap sync output filter Created May 15, 2018, 8:59 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | output.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: edit.sh
diff --git a/edit.sh b/edit.sh
new file mode 100755
index 0000000000000000000000000000000000000000..d26a7d46c2b93a9ebf4e1ed181ce3a48cc3f609e
--- /dev/null
+++ b/edit.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#####################################################################
+#####################################################################
+## The cause of this script is to make the output of the LDAP ##
+## sync cron job more readable by filtering all repeated lines ##
+#####################################################################
+#####################################################################
+
+last_updated=""
+
+while IFS= read -r line; do
+ if echo "$line" | grep -q "Updating" ||
+ echo "$line" | grep -q "Creating"
+ then
+ last_updated="$line"
+ fi
+
+ if echo "$line" | grep -q -v "Updating" &&
+ echo "$line" | grep -q -v "Creating" &&
+ echo "$line" | grep -q -v "Found" &&
+ echo "$line" | grep -q -v "#" &&
+ echo "$line" | grep -q -v "Synchronizing" &&
+ echo "$line" | grep -q -v -F -e "->"
+ then
+ echo $line
+ fi
+
+ if echo "$line" | grep -q -F -e "->"
+ then
+ echo $last_updated
+ echo $line
+ fi
+done
« no previous file with comments | « no previous file | output.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld