shell_android存储设备测试

来源:互联网 发布:黒帽seo做adsense 编辑:程序博客网 时间:2024/04/30 05:10

1.编辑脚本DdTest4Android.sh;用于测试存储设备可靠性。

# !/bin/bash# file name: DdTest4Android.sh# for inand test;# use like:# DdTest4Android.sh /mnt/sdcard/ddreport.txt /mnt/sdcard/sour.dat /mnt/sdcard/dest.dat 10# by bigBird# on 2014-1-14;echoif [ $1 = "help" ]; thenecho "<-- help start -->"echo use like: echo "./DdTest4Android.sh report sour dest recyle"echo ex:echo "DdTest4Android.sh /mnt/sdcard/report.txt /mnt/sdcard/sour.dat /mnt/sdcard/dest.dat 10"echo "<-- help end -->"exit 0fireport=$1sour=$2dest=$3recyle=$4echo "info ===:";echo "info ===:" >> $reportecho "report file: $report"; echo "report file: $report" >> $reportecho "source file: $sour"; echo "source file: $sour" >> $reportecho "dest file: $dest"; echo "dest file: $dest" >> $reportecho "recyle num: $recyle";echo "recyle num: $recyle" >> $reportecho "info ===end";echo "info ===end" >> $reportecho; echo >> $reportrm $destecho "now-----> start"count=0while [ $count -lt $recyle ]; doecho "this count:$count";echo $count >> $reportecho "dd from $sour to $dest";echo "dd from $sour to $dest" >> $reportrm $destdd if=$sour of=$destecho "dd from $dest to $sour";echo "dd from $dest to $sour" >> $reportrm $sourdd if=$dest of=$sourcount=$(($count+1))echo; echo >> $reportdoneecho "now-----> end"echo

2.adb push DdTest4Android.sh /data/local/

3.adb shell;cd /data/local/;chmod 0777 DdTest4Android.sh

4../DdTest4Android.sh help


==========================================================================

5.编辑脚本CpTest4Android.sh:

# !/bin/bash# file name: CpTest4Android.sh# for inand test;# use like:# CpTest4Android.sh /mnt/sdcard/ddreport.txt /mnt/sdcard/sour.dat /mnt/sdcard/dest.dat 10# by bigBird# on 2014-1-14;echoif [ $1 = "help" ]; thenecho "<-- help start -->"echo use like: echo "./CpTest4Android.sh report sour dest recyle"echo ex:echo "./CpTest4Android.sh /mnt/sdcard/report.txt /mnt/sdcard/sour.dat /mnt/sdcard/dest.dat 10"echo "<-- help end -->"exit 0fireport=$1sour=$2dest=$3recyle=$4echo "info ===:";echo "info ===:" >> $reportecho "report file: $report"; echo "report file: $report" >> $reportecho "source file: $sour"; echo "source file: $sour" >> $reportecho "dest file: $dest"; echo "dest file: $dest" >> $reportecho "recyle num: $recyle";echo "recyle num: $recyle" >> $reportecho "info ===end";echo "info ===end" >> $reportecho; echo >> $reportecho "now-----> start"count=0while [ $count -lt $recyle ]; doecho "this count:$count";echo $count >> $reportecho "cp from $sour to $dest";echo "cp from $sour to $dest" >> $reportrm $destsynccp $sour $destsyncsyncsyncsleep 30echo "cp from $dest to $sour";echo "cp from $dest to $sour" >> $reportrm $soursynccp $dest $soursyncsyncsyncsleep 30count=$(($count+1))echo; echo >> $reportdoneecho "now-----> end"echo


0 0