how do you backup?

Place to discuss anything, almost. No politics, religion, Microsoft, or anything else that I (the nazi censor) deem inappropriate.
Post Reply
piratepenguin
user
user
Posts: 8
Joined: Fri Nov 17, 2006 2:56 pm
Location: Ireland
Contact:

how do you backup?

Post by piratepenguin » Sun Nov 19, 2006 7:33 pm

What way do ye backup your stuff?

I really needa sort something out. atm I usually just burn everything to CD every few weeks, and since I run forums and a few wikis now that others might have been using at any time, if my disk fails it'd suck real bad. (besides, backing those up without automating it is tedious)

My important stuff fits in a few hundred megabytes easily. What I gotta do, I think, is write a script that gets all my important files and saves them in a directory, then uses mysqldump to save all my databases in a file in there too. When I start using CVN/SVN I'll have to figure out what to do with them too.

I was thinking of figuring out some HAL magic or whatever it takes so that everytime I plug in my brother's SD card, the script will run and save my stuff onto the card. If the stuff's already there, it'd update it (probably just using rsync).

I'd also setup a cronjob to keep my important stuff up to date on both of my drives, every day or so. Today I found a great service: rsync.net - $1.80 per month for a GB, more than enough space, so if I could use that too and I'd be sorted.

So, how do ye all backup your important stuff?

(PS: I am not a spambot for rsync.net ;))

Jenda
programmer
programmer
Posts: 156
Joined: Mon May 23, 2005 9:46 am
Location: Prague, Czech Republic
Contact:

Post by Jenda » Mon Nov 20, 2006 3:18 am

Hello piratePenguin, nice to see you here :)

I backup manually, but I plan to implement a script involving scp-ing all my data to my other PC.

As for SVN, and BZR in my case, I trust that the repos will hold what there is, so I can just pull again if I lose my copy.

JoeDude
administrator
administrator
Posts: 355
Joined: Sun Feb 08, 2004 1:41 pm
Location: Sutton Coldfield, UK
Contact:

Post by JoeDude » Mon Nov 20, 2006 3:45 am

I don't, I live on the edge!

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Nov 20, 2006 4:00 am

I use many different methods for backups, some of which you already mentioned. At work we use Veritas NetBackup to do full server backups to large robotic tape storage libraries. At home I have various methods. Like you on the web server I have a script to dump the databases and tar up those dumps along with critical directories. I have a job on another machine set to scp that backup file to it and keep a few revisions. On all my other machines I have a specific directory structure in which I keep all my work on. I use rsync to keep them in sync and also keep a copy on my MythTV box for a backup.

If the house burns down I don't really have any off-site storage so the rsync site you mention might be a good idea. There are free storage ways as well. I once played with a Linux file system driver that would turn a Google email account into a file system that you could mount and copy data too. At the time it was pretty buggy, maybe that has improved since I tried it (well over a year ago).

You asked about automatically running a backup script to sync key files to your flash drive that sounds like a cool idea. It should be pretty easy to do by hooking into the hotplug scripts. You might write a script that checks for the existence of a key file on the drive before backing anything up. Maybe put a file called ".backup" on the root directory of the drive. That way it won't back up to any device you plug in.

worker201
guru
guru
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Post by worker201 » Mon Nov 20, 2006 10:56 am

Void Main wrote:If the house burns down I don't really have any off-site storage so the rsync site you mention might be a good idea.
This brings up a good point. My dad goes crazy about backups. He has 2 USB hard drives that he keeps his work stuff on, and he keeps one at the office and one at home. Now he wants to get a 3rd and possibly keep it at my house, just in case his home and office burst into flames on the same day. At some point you have to stop and think about this. Why would he be providing better backups for his digital data than for his personal data? Things like paper documents, much more vulnerable than digital data to "acts of god", are afforded a certain level of protection - the original, and a backup at home, or in a safe deposit box. It becomes kinda ridiculous to try to protect your web server from fires, floods, earthquakes, theft, and device failure with redundant backups in 6 different locations.

So I recognize the need to keep a backup. But I think that it is easy to get carried away. Don't be so scared of losing data that you never have any time to create data.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Nov 20, 2006 11:01 am

I think the goal is to have all of this automated. My backups are all automated so it's not really a time issue. Also, most of my important paper documents are also stored electronically and included in this backup, some of which require raised seals and the like so some of those would have to get recreated after the disaster anyway.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Nov 20, 2006 4:25 pm

Regarding the automatic rsync to your USB drive it would have been done with a hotplug script before where now it would probably take some udev fiddling. You can identify your specific device and do whatever needs to be done based on the device information rather than using a key file on the drive. This looks to be useful information:

http://www.reactivated.net/writing_udev_rules.html

User avatar
xyle_one
programmer
programmer
Posts: 129
Joined: Mon Jan 13, 2003 1:02 pm
Contact:

Post by xyle_one » Thu Nov 23, 2006 12:54 am

Long time no post.

I have weekly backups of my sites thanks to virtualmin, which are scp-'ed to a file server at my house. I don't do full server backups at this time as I really don't know how to go about that in my current situation.

piratepenguin
user
user
Posts: 8
Joined: Fri Nov 17, 2006 2:56 pm
Location: Ireland
Contact:

Post by piratepenguin » Sun Nov 26, 2006 2:37 pm

Jenda wrote:Hello piratePenguin, nice to see you here :)
:D
Void Main wrote:Regarding the automatic rsync to your USB drive it would have been done with a hotplug script before where now it would probably take some udev fiddling. You can identify your specific device and do whatever needs to be done based on the device information rather than using a key file on the drive. This looks to be useful information:

http://www.reactivated.net/writing_udev_rules.html
Indeed it is. I'm not using rsync for the USB drive though.

So in /etc/udev/rules.d/ I created 10-backup.rules which contains:

Code: Select all

KERNEL=="sd?1", SYSFS{size}=="255953", SYMLINK+="dbbackup", RUN+="/home/declan/bin/backup.sh"
and in /home/declan/bin the executable script backup.sh contains:

Code: Select all

#!/bin/sh
if [ $ACTION=="add" ]
  then
    mkdir /tmp/dbbackup 2> /dev/null
    chmod 700 /tmp/dbbackup
    mount -t vfat /dev/dbbackup /tmp/dbbackup
    mv /tmp/dbbackup/.dbs /tmp/dbbackup/.dbs.b 2> /dev/null
    touch /tmp/dbbackup/.dbs
    chmod 600 /tmp/dbbackup/.dbs
    mysqldump --all-databases -h localhost -u thebackupman --password=******* > /tmp/dbbackup/.dbs
    umount /tmp/dbbackup
    rmdir /tmp/dbbackup
fi
So now when I plug in my camera all my databases are backed up onto it in the background.. This udev stuff is pretty handy!

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sun Nov 26, 2006 7:09 pm

Heh heh, you can differentiate between your camera and a specific USB drive if you don't want to back up to every device you plug in. :) I think all of that information is also in the document I linked to. Good solution!

Post Reply