Tuesday, January 27, 2015

How to create a rsync auto backup script with email notification







Step 1 :- First enable a password less SSH to the remote server from you backup PC

Step 2 :- Then copy and paste the below code in to a text file and save as a .sh file


#!/bin/bash
PATH=/bin:/usr/bin:/sbin:/usr/sbin

#### Mail server Data Backup ####
#### Created by Vipin Chereekandy ####
#### chereekandy@gmail.com ####

## Below command will sync the data with the Backup server ###
rsync -avgr -e ssh --delete root@192.168.1.1:/home/data /secondary_bkp/mailserver/.

## Below command will send you an email notification ##
if [ $? != "0" ]
  then
   echo Mail server data Backup is failure|mail -s "Mail server Backup Failure" yourid@example.com
  else
   echo Mail server data Backup is successful|mail -s "Mail server Backup Successful" yourid@example.com
 fi

### End of the script ##


Note : Replace IP address, mail ID and directory path with your own Server base.


Step 3 :- Set a cronjob to run this script



**** Thanks ****





Friday, January 23, 2015

How to Check the Network Bandwidth between two network by using Iperf

Check your Network Bandwidth with Iperf






What is Iperf ?


Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

For this we needs 2 machine, Client(Sender) and Server(Receiver).

Here :-
Node 1 - 192.168.1.1 (Server)
Node 2 - 192.168.2.1 (Client)



From Node 1- (192.168.1.1) :-

Install iperf package
yum -y install iperf

Run the server service from Node 1 (192.168.1.1)
# iperf -s



From Node 2- (192.168.2.1) :-


Install iperf package
yum -y install iperf



Execute the below command from Node 2 (192.168.2.1), This will print the bandwidth.

# iperf -c 192.168.1.1 -fM -m -i5 -t25


Here the output :-

------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 0.02 MByte (default)
------------------------------------------------------------
[  3] local 192.168.2.1 port 41773 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec  3.25 MBytes  0.65 MBytes/sec
[  3]  5.0-10.0 sec  2.75 MBytes  0.55 MBytes/sec
[  3] 10.0-15.0 sec  3.00 MBytes  0.60 MBytes/sec
[  3] 15.0-20.0 sec  2.88 MBytes  0.57 MBytes/sec
[  3] 20.0-25.0 sec  3.00 MBytes  0.60 MBytes/sec
[  3]  0.0-25.3 sec  15.0 MBytes  0.59 MBytes/sec
[  3] MSS size 1376 bytes (MTU 1416 bytes, unknown interface)


For more detail execute this command :
# man iperf



Thank You
****



Wednesday, January 14, 2015

How to Remove NIC bonding in LINUX CentOS



Steps to Remove NIC bonding in LINUX CentOS



# ifconfig bond0 down

# echo "-eth0" > /sys/class/net/bond0/bonding/slaves
# echo "-eth1" > /sys/class/net/bond0/bonding/slaves
# echo "-bond0" > /sys/class/net/bonding_masters

# rmmod bonding

# service network restart



***********