DHT磁力链接搜索引擎 python编写

cd /home
tar zxvf zsky.tar.gz
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl stop iptables.service
systemctl disable iptables.service
setenforce 0
sed -i s/"SELINUX=enforcing"/"SELINUX=disabled"/g /etc/sysconfig/selinux
cd zsky
yum -y install wget gcc gcc-c++ python-devel mariadb mariadb-devel mariadb-server
yum -y install epel-release python-pip redis
pip install -r requirements.txt
pip install redis
systemctl start mariadb.service
systemctl enable mariadb.service
systemctl start redis.service
systemctl enable redis.service
mysql -uroot -e"create database zsky default character set utf8mb4;"
python manage.py init_db
#建表
python manage.py create_user
#按照提示输入用户名、密码、邮箱
nohup gunicorn -k gevent --access-logfile zsky.log --error-logfile zsky_err.log manage:app -b 0.0.0.0:80 --reload>/dev/zero 2>&1&
#开启网站访问,访问日志是当前目录下zsky.log,错误日志是当前目录下zsky_err.log
#如果不想要日志 就运行下面这条命令
#nohup gunicorn -k gevent manage:app -b 0.0.0.0:80 --reload>/dev/zero 2>&1&
nohup python simdht_worker.py >/dev/zero 2>&1&

#开机自启动
chmod +x /etc/rc.d/rc.local
echo "systemctl start mariadb.service" >> /etc/rc.d/rc.local
echo "systemctl start redis.service" >> /etc/rc.d/rc.local
echo "cd /home/zsky" >> /etc/rc.d/rc.local
echo "nohup python simdht_worker.py >/dev/zero 2>&1&" >> /etc/rc.d/rc.local
echo "nohup gunicorn -k gevent manage:app -b 0.0.0.0:80 --reload>/dev/zero 2>&1&" >> /etc/rc.d/rc.local

ps -ef|grep python
kill -9 xxx
python simdht_worker.py

 

0 * * * * ps -ef | grep "python simdht_worker.py" | grep -v grep | awk '{print $2}' | xargs kill -9
1 * * * * cd /root/zsky/ && python simdht_worker.py

zsky.tar

 

/usr/bin/mysqldump  -u root -p zsky | gzip > /root/zsky.sql.gz

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注