How do I write a bash script to restart a server?
Answer
How To Use a Bash Script To Restart Linux Server Services
Answer
How To Use a Bash Script To Restart Linux Server Services
- sudo nano /opt/launch-crashed-services.sh. …
- The script uses the service <name> status command to output the status of a particular service such as mysql. …
- Save the file to /opt/launch-crashed-services.sh. …
- sudo chmod +x /opt/launch-crashed-services.sh. …
- sudo crontab -e.