<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_quote"><br></div></div></div></blockquote>
<div>Okay Matt (or anyone else who wants to answer this), could I do this:</div><div>first I make a directory in the usb called 'bmike1-backup'</div><div><br></div><div>#!/bin/bash </div><div>sudo mkdir /backups <-create backups dir</div>
<div>sudo mount /sdc1/backup-bmike1 /backups <- tell computer to see a directory in the usb drive as /backups</div><div>rsync -av /home/bmike1</div><div>sudo umount backups; sudo rmdir backups <-make everything like it was</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_quote">On Sat, Jun 29, 2013 at 12:45 PM, Matt Graham <span dir="ltr"><<a href="mailto:danceswithcrows@usa.net" target="_blank">danceswithcrows@usa.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1. Plug this disk in. Usually, removable disks have 1 partition of type FAT32<br>
or NTFS covering their whole space. (Check that this is the case, if not,<br>
something weird may be going on.)<br>
<br>
2. Make a filesystem with a label on this partition. "mke2fs -j -L MY_BACKUPS<br>
/dev/sdN1" . Find what N is by looking at the output of dmesg | tail.<br>
<br>
3. Make an entry for the partition you made in your /etc/fstab :<br>
<br>
LABEL=MY_BACKUPS /mnt/backup ext3 noauto,users,noatime 0 0<br>
<br>
4. As root, mkdir /mnt/backup if it doesn't exist, then mount this partition<br>
on /mnt/backup , mkdir /mnt/backup/USER , and chown USER /mnt/backup/USER .<br>
<br>
5. Make a shell script sort of like this:<br>
<br>
#!/bin/bash<br>
if [[ $1 == '--help' || $1 == '-h' ]] ; then<br>
echo "backs up ~USER to backup drive."<br>
exit;<br>
fi<br>
<br>
if mount | grep /mnt/backup > /dev/null ; then<br>
rsync -av --delete-after /home/USER/ /mnt/backup/USER<br>
else<br>
echo "backup disk not mounted. Trying to mount it."<br>
mount /mnt/backup<br>
if mount | grep /mnt/backup > /dev/null ; then<br>
echo "Is the disk plugged in? Can't mount, bailing."<br>
exit 1<br>
fi<br>
rsync -av --delete-after /home/USER/ /mnt/backup/USER<br>
umount /mnt/backup<br>
fi<br>
<br>
6. Any time you want to make a backup, plug your disk in, and run that shell<br>
script. The initial rsync will take some time. Subsequent rsyncs will take a<br>
couple of minutes.<br>
<br>
This is AFAICT a reasonably good way to do things, because it doesn't take a<br>
lot of time to keep your backup up to date, and restoring is as simple as<br>
mounting the backup disk and copying things over. Since there is only 1<br>
backup, though, you could delete something, make a backup, then realize you<br>
needed that thing. I have 2 backup disks and rotate them every few days to<br>
make that less likely.<br>
<br>
You could even get fancy and use dm-crypt to back up your stuff to an<br>
encrypted disk, which is useful in some situations like when you want to leave<br>
the disk somewhere that's not under your direct control like a friend's house.<br>
Using dm-crypt makes things a bit more complex, but I can write another<br>
message about that.<br>
<span><font color="#888888"><br>
--<br>
Matt G / Dances With Crows<br>
The Crow202 Blog: <a href="http://crow202.org/wordpress/" target="_blank">http://crow202.org/wordpress/</a><br>
There is no Darkness in Eternity/But only Light too dim for us to see<br>
<br>
---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
</font></span></blockquote></div><br>
</div></div></blockquote></div><br>