There was an error while loading. Please reload this page.
1 parent 91861fa commit be44cb4Copy full SHA for be44cb4
bash_shell/q&a/solution/clearlogs.sh
@@ -0,0 +1,10 @@
1
+#!/bin/bash
2
+#
3
+# This script copies /var/log contents and clears current contents of the file
4
+
5
6
+cp /var/log/messages /var/log/messages.old
7
+cat /dev/null > /var/log/messages
8
+echo log file copied and cleaned up
9
10
+exit 0
0 commit comments