定时启停Nginx服务
说明:
1、keepalived+Nginx服务,先停止keepalived,后停止nginx服务。
2、每天19点30分停止Nginx服务
3、keepalived+Nginx服务,先启动nginx服务,后启动keepalived服务。
4、每天7点01分定时启动Nginx服务
1、停止nginx服务
[root@localhost ~]# cat /home/fsapp/nginx-stop.sh
#! /bin/bash
systemctl stop keepalived
systemctl status keepalived
sleep 2
systemctl stop nginx
systemctl status nginx
ps aux |grep nginx
1)定时任务
# 每天19点停止nginx服务
30 19