Skip to content

Commit be44cb4

Browse files
Create clearlogs.sh
1 parent 91861fa commit be44cb4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)