Shell script
Posted: Tue Apr 12, 2016 1:41 pm
Hello all, i am a beginner with servers and i have a small problem
WHen my server reboot or restart in the middle of the night then i need to wake up to launch some commands as some processes dont launch automaticaly, here are the 4 command line i need to input each time manualy. is there a way to make this automaticaly so i dont need to log each time as its hurt my game reputation, i have really no idea where to start for this
In case of i am using centos 7
# service nginx start
# service nginx status
# /etc/init.d/vesta start
# service httpd start
This is where i started
#!/bin/bash
echo “Starting up nginx environment…”
service nginx start
echo “Status nginx environment…”
service nginx status
echo “Starting up vesta environment…”
/etc/init.d/vesta start
echo “Starting up httpd environment…”
service httpd start
echo "Server restarted succesfully."
And i added in the crontab file @reboot /startup.sh
Regards
WHen my server reboot or restart in the middle of the night then i need to wake up to launch some commands as some processes dont launch automaticaly, here are the 4 command line i need to input each time manualy. is there a way to make this automaticaly so i dont need to log each time as its hurt my game reputation, i have really no idea where to start for this
In case of i am using centos 7
# service nginx start
# service nginx status
# /etc/init.d/vesta start
# service httpd start
This is where i started
#!/bin/bash
echo “Starting up nginx environment…”
service nginx start
echo “Status nginx environment…”
service nginx status
echo “Starting up vesta environment…”
/etc/init.d/vesta start
echo “Starting up httpd environment…”
service httpd start
echo "Server restarted succesfully."
And i added in the crontab file @reboot /startup.sh
Regards