Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive

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

how do you back up data on your home computer?

hi all.

a while back i heard somebody say to keep 3 copies of everything.  so for a
while i would have a local copy of my stuff, another copy on an external
hard drive and a third copy on dvd+r.  (i still have this set up for my
music and movies.)  anyway, i wanted to do something different for my
documents.  it's not a lot of stuff, taxes, resumes, passwords, photos,
etc...  so i'm keeping a working copy on my laptop, a copy on a usb drive
and a copy in heaven (aka the cloud).  i just whipped up a little script to
do it, see below.  but i was wondering what some of you guys do?

eric c. - the one who's so happy to have wiped win7 and went back to linux
on my laptop.

#    usage: <path/to/directory> <password> <path/to/backup>
#    example: /home/eric/Documents somepass '/home/eric/Ubuntu
#    note:  i assume this is on a trusted home system as the pass is in bash

# tar it
tar cvf $(date +%Y%m%d)_backup.tar $1

# encrypt it
echo $2 | gpg --batch --no-tty --armor --passphrase-fd 0 --symmetric $(date
rm $(date +%Y%m%d)_backup.tar

# compress it
gzip $(date +%Y%m%d)_backup.tar.asc

# move it
mv $(date +%Y%m%d)_backup.tar.asc.gz "$3"

# only keep the last three backups
cd "$3"
array=($(ls -t *_backup.tar.asc.gz))
#echo ${array[*]}
unset array[0]
unset array[1]
unset array[2]
rm ${array[*]}
unset array

# the update to the cloud happens independently of this script
# see

BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!

Boston Linux & Unix /