复制*.mp3 到当前系统的Music目录下
find . -name -type f "*.mp3" -o -name "*.flac" -exec cp -fv {} ~/Music \;
{}为找到的内容
1,find先找到内容,然后通过-exec执行cp -fv {} ~/Music
2,\; 注意\与;之间无空格
slackware 13.37安装goagent
1,安装python2.7
系统默认安装的2.6无法启动goagent3.0
$wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2 && tar jxvf Python-2.7.5.tar.bz2 && cd Python-2.7.5 && ./configure --with-zlib && make && sudo make install
2,安装gevent
系统版本过低
$curl -L -O https://github.com/downloads/surfly/gevent/gevent-1.0rc2.tar.gz && tar xvzpf gevent-1.0rc2.tar.gz && cd gevent-1.0rc2 && sudo python setup.py install
3,安装pyopenssl $wget http://pkgs.fedoraproject.org/repo/pkgs/pyOpenSSL/pyOpenSSL-0.13.tar.gz/767bca18a71178ca353dff9e10941929/pyOpenSSL-0.13.tar.gz && tar zxvf pyOpenSSL-0.13.tar.gz && cd pyOpenSSL-0.13 && sudo python setup.py install
4,接下来就是下载goagent,编辑python.ini和upload upload.zip档案咯~~
goagent服务开机自启动脚本
1 rc.goagent
#!/bin/bash
NAME=goagent
PRO=proxy.py
ROOT_DIR=/opt/goagent/local
ps x|grep $PRO|awk 'NR==1 {print $7}'|while read line
do
var=$line
done
ps x|grep $PRO|awk 'NR==1 {print $1}'|while read goid
do
var_id=$goid
done
go_start(){
if [ "$var" = "$PRO" ]; then
echo "Staus:in running......"
else
$PPY $ROOT_DIR$PRO
if [ "$var" = "$PRO" ]; then
echo "Succeed running......"
else
echo "Start again."
fi
fi
}
go_stop(){
if [ "$var" = "$PRO" ]; then
kill -9 $var_id
else
echo "gogent is not running yet."
fi
}
go_restart(){
if [ "$var" = "$PRO" ]; then
echo "Staus:in running......"
kill -9 $var_id
$PPY $ROOT_DIR$PRO
else
$PPY $ROOT_DIR$PRO
if [ "$var" = "$PRO" ]; then
echo "Succeed running......"
else
echo "Start again."
fi
fi
}
case $1 in
start) go_start
;;
stop) go_stop
;;
restart) go_restart
;;
*) cat << ENTER
Usage:$0 start|stop|restart
ENTER
;;
esac
2 编写对应的rc.X
vim rc.3
#!/bin/bash
if [ -x /etc/rc.d/rc.goagent ]; then
sh rc.goagent start
fi