Skip to main content

Posts

Showing posts from April, 2009

Basic Linux Configuration backup

#!/bin/bash # Title: Linux Primary Configuration Backup # Version: 1.5 # Last update: 06-08-2012 # Author: Hareesh V V # E Mail: tux.psycho@gmail.com # Web: http://www.psychotux.com DATE=`date +%d%m%y` BKP=~/`hostname`.BACKUPS_$DATE /bin/mkdir -p $BKP tar -cjf $BKP/etc_$DATE.tar.bz2 /etc /sbin/ifconfig > $BKP/ifconfig /sbin/route -n > $BKP/route /sbin/runlevel > $BKP/runlevel /sbin/chkconfig --list | grep 3:on > $BKP/chkconfig_init_3 /sbin/chkconfig --list | grep 5:on > $BKP/chkconfig_init_5 /bin/hostname > $BKP/hostname lsmod > $BKP/lsmod cat /etc/hosts > $BKP/etc_hosts cat /etc/resolv.conf > $BKP/etc_resolv  cat /etc/grub.conf > $BKP/grub_conf  #crontab -l > $BKP/crontab /sbin/iptables -L  > $BKP/iptables_filter /sbin/iptables -t nat -L > $BKP/iptables_nat /sbin/iptables-save > $BKP/iptables cat /etc/sysconfig/iptables-config > $BKP/iptables-config /bin/netstat -ntpl > $BKP/netstat mount > $BKP/mount f