#!/bin/sh
source /etc/profile
hostip=$(ifconfig eth0 |grep "inet"|grep -v inet6|awk -F ' ' '{print $2}' #|awk -F ':' '{print $2}')
backuppath=/data/backup/$hostip.`date +%y%m%d`.backup
mkdir -p $backuppath
date=`date +%Y%m%d`
##### backup hosts,network,rc.local #####
echo "star backup hosts,hostname file"
cd $backuppath
cp --parents -p /etc/hosts .
cp --parents -p /etc/sysconfig/network .
cp --parents -p /etc/rc.d/rc.local .
cp --parents -p /etc/passwd .