This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stop dance for nginx | |
# ======================= | |
# | |
# ExecStop sends SIGSTOP (graceful stop) to the nginx process. | |
# If, after 5s (--retry QUIT/5) nginx is still running, systemd takes control | |
# and sends SIGTERM (fast shutdown) to the main process. | |
# After another 5s (TimeoutStopSec=5), and if nginx is alive, systemd sends | |
# SIGKILL to all the remaining processes in the process group (KillMode=mixed). | |
# | |
# nginx signals reference doc: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: ./script.sh <username> <password> <host> <port> <target-folder (optional)> | |
# Example: ./script.sh admin admin 127.0.0.1 3306 /var/backups/mysql | |
# Default dump folder is /var/backups/mysql | |
if [ -z "$1" ]; then | |
echo "The usage is: <username> <password> <host> <port> <target-folder (optional)>"; | |
exit; | |
elif [ -z "$2" ]; then |