IP Stories

“A Written IP Related Activities”

Script Back Up Sample

Posted by a. Rahman Isnaini r. Sutan on April 18, 2008

#/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 –

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>