In step 3 the "LABEL=..." entry in fstab makes it so that whatever has the
label MY_BACKUPS will be seen as the proper device regardless of whether it
is sdc, sdc1, sdd, etc....?
0. Buy a USB2 disk that has enough space to hold all the stuff in your home
dir plus at least a few G more (data tends to get bigger with time, of
course)
1. Plug this disk in. Usually, removable disks have 1 partition of type
FAT32
or NTFS covering their whole space. (Check that this is the case, if not,
something weird may be going on.)
2. Make a filesystem with a label on this partition. "mke2fs -j -L
MY_BACKUPS
/dev/sdN1" . Find what N is by looking at the output of dmesg | tail.
3. Make an entry for the partition you made in your /etc/fstab :
LABEL=MY_BACKUPS /mnt/backup ext3 noauto,users,noatime 0 0
4. As root, mkdir /mnt/backup if it doesn't exist, then mount this partition
on /mnt/backup , mkdir /mnt/backup/USER , and chown USER /mnt/backup/USER .
5. Make a shell script sort of like this:
#!/bin/bash
if [[ $1 == '--help' || $1 == '-h' ]] ; then
echo "backs up ~USER to backup drive."
exit;
fi
if mount | grep /mnt/backup > /dev/null ; then
rsync -av --delete-after /home/USER/ /mnt/backup/USER
else
echo "backup disk not mounted. Trying to mount it."
mount /mnt/backup
if mount | grep /mnt/backup > /dev/null ; then
echo "Is the disk plugged in? Can't mount, bailing."
exit 1
fi
rsync -av --delete-after /home/USER/ /mnt/backup/USER
umount /mnt/backup
fi
6. Any time you want to make a backup, plug your disk in, and run that shell
script. The initial rsync will take some time. Subsequent rsyncs will
take a
couple of minutes.
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss