1

Add original scripts

This commit is contained in:
eleksir
2016-09-04 22:20:40 +03:00
commit 8e3af042d2
128 changed files with 19003 additions and 0 deletions

20
log_rotation.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
if [ "$1" = "" ]; then
/bin/echo "no file"
elif [ "$1" = "/tmp/rsyslog/root_file" ]; then
/bin/rm -f "$1"
else
new_file=$1"_"`/bin/date '+20%y_%m_%d'`
i=0
test_file=$new_file
while [ -f $test_file ]
do
i=$(($i+1))
test_file=$new_file"."$i
done
/bin/mv -f "$1" $test_file
fi
exit 0