项目服务批处理(2019.9)

当前项目使用redis数据库, fastdfs分布式文件管理系统, nginx服务器, 以及django自带的服务器

开启服务:

#! /bin/bash
echo -e "33[34m-----Start-----33[0m" sudo /usr/local/nginx/sbin/nginx echo $?
sudo redis-server /etc/redis/redis.conf echo $?
sudo /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf echo $?
sudo /usr/bin/fdfs_storaged /etc/fdfs/storage.conf echo $?
echo
echo -e "33[34m----------33[0m"
ps aux|grep 'redis|fdfs|nginx|python'
echo -e "33[34m----------33[0m"


关闭服务:

#! /bin/bash
echo -e "33[34m-----Stop-----33[0m"
sudo /usr/local/nginx/sbin/nginx -s stop
echo $?
sudo killall fdfs_trackerd echo $?
sudo killall fdfs_storaged echo $?
sudo killall redis-server echo $?
echo echo -e "33[37m----------33[0m"
ps aux|grep 'redis|fdfs|nginx|python'
echo -e "33[37m----------33[0m"
原文地址:https://www.cnblogs.com/jrri/p/11565568.html