Doug Crompton on 27 Oct 2007 06:15:00 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] non-nerdy ... a non-rant


I just use 'cp' to copy files from the source disk to an external USB
disk, copying on a partition by partition basis. The backup disk
partitioning matches the source. Size of the destination partitions does
not matter as long as they are at least as large as the source.

One drawback is that files that have been deleted (and backed up on a
prior backup) remain on the backup. I get around this by using two backup
drives and occasionally deleting all files on the backup and starting
fresh. This backup script only backs up files that have changed.

Although I have never had to do it the backup drive should be replacable
to the main drive for booting shold that be necessary.

Doug


#!/bin/bash
#
# Backup Entire File System
#
echo "Last Backup - (USB) "`date` > /root/bin/last_backup
echo "Running USB Mount"
#
echo "Boot Partition Mount"
/bin/mount -t ext2 /dev/sda5 /backup/boot
# hdb6 is swap
echo "Root Partition Backup"
/bin/mount -t ext3 /dev/sda7 /backup/root
echo "usr Partition Mount"
/bin/mount -t ext3 /dev/sda8 /backup/usr
echo "var Partition Mount"
/bin/mount -t ext3 /dev/sda9 /backup/var
echo "home Partition Mount"
/bin/mount -t ext3 /dev/sda10 /backup/home
echo "opt Partition Mount"
/bin/mount -t ext3 /dev/sda11 /backup/opt
#
echo "boot Partitiion Backup"
/bin/cp -axu  /boot /backup
echo "root Partition Backup"
/bin/cp -axu  / /backup/root/
echo "usr Partition Backup"
/bin/cp -axu /usr /backup
echo "var Partition Backup"
/bin/cp -axu /var /backup
echo "home Partition Backup"
/bin/cp -axu /home /backup
echo "opt Partition Backup"
/bin/cp -axu /opt /backup
#
#
# unmount Backup File System
#
/bin/umount /dev/sda5
# sda6 is swap
/bin/umount /dev/sda7
/bin/umount /dev/sda8
/bin/umount /dev/sda9
/bin/umount /dev/sda10
/bin/umount /dev/sda11

echo "umount Backup - Backup Complete"





****************************
*  Doug Crompton	   *
*  Richboro, PA 18954	   *
*  215-431-6307		   *
*		  	   *
* doug@crompton.com        *
* http://www.crompton.com  *
****************************


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug