Copying Directories and Files
dd Copying / on /dev/hda1 to a /dev/hdb1 ( backup disk )
dd if=/dev/hda1 of=/dev/hdb1 bs=1024k
tar | tar Copying /home on /dev/hda5 to a /dev/hdb5 ( backup disk )
mount /dev/hdb5 /mnt/backup
( tar cf - /home ) | ( cd /mnt/backup ; tar xvfp - )
umount /mnt/backup
scp Copying /home on /dev/hda5 to a /dev/hdb5 ( backup disk )
mount /dev/hdb5 /mnt/backup
scp -par /home /mnt/backup
umount /mnt/backup
scp -pr user1@host:/Source_to_Backup user2@BackupServer:/Backup_Dir
find | cpio Copying /home on /dev/hda5 to a /dev/hdb5 ( backup disk )
mount /dev/hdb5 /mnt/backup
find /home -print | cpio -pm /mnt/backup
umount /mnt/backup
To View Contents
cpio -it < file.cpio
To Extract a file
cpio -id "usr/share/file/doc/*" < file.cpio
Creating Backup Files
tar Backup /home to ( backup disk )
mount /dev/hdb5 /mnt/backup
tar zcvf /mnt/backup/home.Date.tgz /home > /mnt/backup/home.Date.log
umount /mnt/backup
Encrypt home.Date.tgz if security of sensitive data is an issue
Example Full/Incremental Script
Typical list of directories you WANT to backup regularly...
DIRS is typically: /root /etc /home/
Using Month/Date for Backup Filenames
date `%Y.%M.%D"
Simple Full Backup
tar zcvf /Backup_Dir/Month_Date.Full.tgz $DIRS
Simple Incremental Backups
Change the Month_Date.tgz file
Backup the files to a Different Server:/Disks [ reasons ]
Simple Daily Incremental Backup
find $DIRS -mtime -1 -type f -print | tar zcvf /BackupDir_1/Month_Date.tgz -T -
Simple Weekly Incremental Backup
find $DIRS -mtime -7 -type f -print | tar zcvf /BackupDir_7/Month_Date.7.tgz -T -
use -mtime -32 to cover for un-noticed failed incremental backups from last week
Simple Monthly Incremental Backup
find $DIRS -mtime -31 -type f -print | tar zcvf /BackupDir_30/Year_Month.30.tgz -T -
use -mtime -93 to cover for un-noticed failed incremental backups from last month
Showing posts with label Creating Backup Files. Show all posts
Showing posts with label Creating Backup Files. Show all posts
Thursday, December 31, 2009
Subscribe to:
Posts (Atom)
