Simple Script for Backuping Files

Posted on April 18, 2008. Filed under: Backup, linux, Script, unix |

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

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: