#/bin/bash
#cd /
mt -f /dev/st0 status
sleep 3
mt -f /dev/st0 rewind
sleep 3
tar -cvf /dev/st0 -b 512 /var/www/ /var/lib/mysql/ /etc/httpd/ /var/named/chroot/ /etc/php.ini /etc/named.conf /etc/my.cnf > /var/log/backup/backup-tape-`date “+%Y%m%d”`.txt
sleep 2
gzip /var/log/backup/backup-tape-`date “+%Y%m%d”`.txt
sleep 20
#chown nmc /var/log/backup/backup-log-`date “+%Y%m%d”`.txt.gz
mt -f /dev/st0 offline
Here the data in which will be backed up by the script :
/var/www/ –> File-file web
/var/lib/mysql/ –> file-file databases
/etc/httpd/ –> Configuration Apache Web Server
/var/named/chroot/ –> Database Record DNS
/etc/php.ini –> Configuration PHP
/etc/named.conf –> Configuration DNS server
/etc/my.cnf –> Configuration MySQL Server
– IP –