Restart Apache if failed
This bash script check web site every 5 minutes, restart the web server if web site is not responding. Create a file…
This bash script check web site every 5 minutes, restart the web server if web site is not responding. Create a file…
You can find process id for a running program with command pidof BINARY_NAME_HERE Example boby@sok-01:~$ pidof gedit 22057 boby@sok-01:~$ ps aux |…
To check if a folder is empty of not, you can use if [ “$(ls -A /home/boby/1/ )” ] then echo “Files…
To check if a directory exists in bash, use if [[ -d “/path/to/directory/” ]] then echo “Directory found.” fi To check for…
This script will check disk usage on / partition and email you if disk usage is above 80% We can use df…
Check if first augment to script is –help if [ “$1” = “–help” ]; then echo “$0 –help = shows help” exit…