Restart Apache if failed

Restart Apache if failed

This bash script check web site every 5 minutes, restart the web server if web site is not responding. Create

Bash check if a program is running or not

Bash check if a program is running or not

You can find process id for a running program with command Example We can use pidof command in bash script

bash check if a folder is empty or not

bash check if a folder is empty or not

To check if a folder is empty of not, you can use If you want to reverse the checking, you

Bash check if a directory exists

Bash check if a directory exists

To check if a directory exists in bash, use To check for absense of a directory, use ! See bash

Bash Script to Monitor Disk Usage

Bash Script to Monitor Disk Usage

This script will check disk usage on / partition and email you if disk usage is above 80% We can

Bash if statement

Bash if statement

Check if first augment to script is –help Check if a file exists and is executable Check if a binary

bash

bash

Bash shortcuts Enable color prompt Edit .bashrc, add following Logging Linux Commands for all users Bash if statement Bash Script