linux shell ¿ØÖƽű¾Ö´ÐдÎÊý
ÏÂÃæÊÇ°³Ð´µÄ²âÊԽű¾£¬ÎªÁËÄÜÔËÐжà´Î²âÊÔ³ÌÐòÐÔÄÜ£¬Ïë¿ØÖÆÔËÐиöÊý£¬Í¨¹ýlockfile ºÍ grepÅäºÏ½øÐÐÏÞÖÆ¡£
#!/bin/bash
. /etc/profile
project=simnin
export CLASSPATH=.:/usr/$project:$CLASSPATH
for jarfile in /usr/$project/lib/*.jar ; do
if ! echo $CLASSPATH | grep $jarfile > /dev/null
then
export CLASSPATH=$CLASSPATH:$jarfile
fi
done
#echo $#
#echo $*
#echo $0 $1 $2 $3
#run once when lock file
lckfile="/tmp/.perfomanceTest.lck"
lockfile -1 -r 60 $lckfile
log=/tmp/perftest.log
echo >> $log
lmt=1
if [ "`date +%H`" -lt 8 -o "`date +%H`" -gt 18 ]; then
lmt=10
fi
prog="com.lj.PerformanceTest"
ps -ef | grep $prog | grep "grep $prog" -v >>$log
cnt=`ps -ef | grep $prog | grep "grep $prog" -v -c `
if [ "$cnt" -gt "$lmt" ]; then
rm -f $lckfile
echo "exit 1 when $cnt > $lmt ." >>$log
exit 1;
fi
echo "$$ start at `date`" >>$log
#echo =====================ENV============== >>$log
#env >>$log
echo =====================CMD============== >>$log
echo $0 $* >> $log
$JAVA_HOME/bin/java com.lj.PerformanceTest $* >>$log 2>&1 &
rm -f $lckfile
echo "$$ $! is running" >>$log
echo "$$ end at `date`" >>$log
Ïà¹ØÎĵµ£º
linuxϵͳÎļþ½éÉÜ
Îļþϵͳ·ÖΪÐí¶à²¿·Ö£¬Í¨³£´Ó¸ùÎļþϵͳÓУº /bin , /lib , /etc , /dev ,
¼°Ò»Ð©ÆäËû£» /usr Îļþϵͳ°üº¬³ÌÐòºÍ²»¸Ä±äµÄÊý¾Ý£» /var Îļþϵͳ°üº¬¸Ä±äµÄÊý¾Ý(ÀýÈçlogÎļþ)£» /home
Îļþϵͳ°üº¬Ã¿¸öÓû§µÄ¸öÈËÎļþ¡£
ÿ̨»úÆ÷¶¼ÓиùÎļþϵͳ/
(Ò»°ãÔÚ±¾µØÅÌÖУ¬µ±È»Ò²¿ÉÒÔÔ ......
Ëæ×ÅLinuxµÄÓ¦ÓÃÈÕÒæ¹ã·º£¬ÌرðÊÇÔÚÍøÂçÓ¦Ó÷½Ã棬ÓдóÁ¿µÄÍøÂç·þÎñÆ÷ʹÓÃLinux²Ù×÷ϵͳ¡£ÓÉÓÚLinuxµÄ×ÀÃæÓ¦ÓúÍWindowsÏà±È»¹ÓÐÒ»¶¨µÄ²î¾à£¬ËùÒÔÔÚÆóÒµÓ¦ÓÃÖÐÍùÍùÊÇLinuxºÍWindows²Ù×÷ϵͳ¹²´æÐγÉÒì¹¹ÍøÂç¡£ÔÚ·þÎñÆ÷¶Ë´ó¶àʹÓÃLinuxºÍUnixµÄ£¬Ä¿Ç°LinuxµÄÉó¤Ó¦ÓÃÁìÓòÊǵ¥Ò»Ó¦ÓõĻù´¡·þÎñÆ÷Ó¦Óã¬Æ©ÈçDNSºÍDHCP·þÎñÆ÷¡¢W ......
linux 2.6Äں˽ø³Ì¹ÜÀí
linuxÿ¸ö½ø³Ì¶ÔÓ¦Ò»¸ötask_structÀàÐͽṹ¡£¸Ã½á¹¹°üº¬½ø³ÌÏà¹ØµÄËùÓÐÐÅÏ¢¡£linux½ø³Ìͨ¹ýlist_head×é֯˫ÏòÁ´±í£¬Ã¿Ò»¸ö½áµã¾ÍÊÇÒ»¸ö½ø³ÌÃèÊö·û¡£½ø³ÌÃèÊö·ûÀïÃæ°üº¬Á˽ø³ÌËùÓеÄÐÅÏ¢£º½ø³ÌËù´ò¿ªµÄÎļþ¡¢½ø³ÌµÄµØÖ·¿Õ¼ä¡¢¹ÒÆðÐźš¢½ø³Ì״̬ºÍÆäËû¸ü¶àµÄÐÅÏ¢¡£ÒÔÏÂÊǽø³ÌÃèÊö· ......
×÷ÕߣºÎ¤¶«É½,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦¡£
Ëæ×ÅǶÈëʽÐÐÒµÓ²¼þƽ̨µÄÐÔÄÜÔöÇ¿£¬ÏîÄ¿ÐèÇóºÍ¹¦ÄÜÈÕÒ渴ÔÓ£¬ARM¹«Ë¾ÍƳöµÄ CORTEX-M3£¬¸üÊÇÈÃÒÔÍù×öµ¥Æ¬»úµÄ¹¤³ÌʦÔÚоƬºÍ¼¼ÊõÑ¡ÐÍÃæÁÙÁ½ÄÑÑ¡Ôñ£¬±¾×¨Ì⽫´ÓоƬ¼Û¸ñ¡¢Õû¸öϵͳµÄÓ²¼þÈí¼þÉè¼Æ¼°Î¬»¤µÄ³É±¾µÈ¸÷¸ö·½Ãæ¸øÄúÌṩһ¸ö²Î¿¼£¬ ²¢´Ó¼¼Êõ½Ç¶È·ÖÎöµ¥Æ¬»úºÍ´ø²Ù×÷ϵͳµÄÏ ......
¹ØÓÚlinuxÏÂÁ½ÖÖÄÚ´æÒýµ¼Ä£Ê½µÄÇø±ð
Linux µÄ initrd ¼¼ÊõÊÇÒ»¸ö·Ç³£ÆÕ±éʹÓõĻúÖÆ£¬linux2.6 ÄÚºËµÄ initrd µÄÎļþ¸ñʽÓÉÔÀ´µÄÎļþϵͳ¾µÏñÎļþת±ä³ÉÁË cpio ¸ñʽ£¬±ä»¯²»½ö·´Ó³ÔÚÎļþ¸ñʽÉÏ£¬ linux Äں˶ÔÕâÁ½ÖÖ¸ñʽµÄ initrd µÄ´¦ÀíÓÐ׎ØÈ»µÄ²»Í¬¡£
initrd µÄÓ¢Îĺ¬ÒåÊÇ boot loader ......