blob: 8b2a4a7e87e0593952e9109b9d8e19d635267f0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#!bin/sh
function logcmd()
{
echo -e "\n"
}
function exe_cmd()
{
logcmd "$@";
eval $@;
}
dstdir="/data/ylog/"
fwc_dir="fwreboot/"
sp="-"
sys_debug_fwc=sys.debug.fwc
persist_sys_ylog_fwc=persist.sys.ylog.fwc
fwc_prop=`getprop ${sys_debug_fwc}`
time_now=$(date "+%Y%m%d%H%M%S")
count=0
if [ $fwc_prop -ge 1 ];then
cd $dstdir
if [ ! -d $fwc_dir ];then
exe_cmd "mkdir $fwc_dir"
chmod 777 $fwc_dir
fi
cd $fwc_dir
count=$(getprop $persist_sys_ylog_fwc)
if [ -z "$count" ];then
count=0
else
count=$(getprop $persist_sys_ylog_fwc)
fi
exe_cmd "mkdir $count$sp$time_now"
chmod 777 $count$sp$time_now
cd $count$sp$time_now
exe_cmd "dmesg -T > $dstdir$fwc_dir$count$sp$time_now/kernel.log"
exe_cmd "logcat -d > $dstdir$fwc_dir$count$sp$time_now/android.log"
chmod 666 "kernel.log"
chmod 666 "android.log"
count=$((count+1))
exe_cmd "setprop $persist_sys_ylog_fwc $count"
fi
if [ $count -gt 10 ];then
path="/data/ylog/fwreboot/"
cnt=0
min=$count
min_file="XXX"
for dir in $(ls $path)
do
[ -d $dir ] && echo $dir
cnt=$((cnt+1))
if [ ${dir%%-*} -lt $min ];then
min=${dir%%-*}
min_file=$dir
fi
if [ $cnt -eq 11 ];then
exe_cmd "rm -rf $path$min_file"
fi
done
fi
echo "done"
|