Backing up in Linux

OK, now I’m at over 90% Linux usage and have taken time to setup different things and don’t want these settings lost.

I was thinking I could compress my home directory and be done with it, but when I did a google search I saw something about “rsync”.

I’m sure I’ll research it some more, but what is a good system for backing up in Linux? What do you do?

What I’m going to want to do soon is repartition my drive and make the Windows partition really small and the rest a Linux one, so I’ll have a chance toput the system to the test :slight_smile:.

[quote=“miltownkid”]OK, now I’m at over 90% Linux usage and have taken time to setup different things and don’t want these settings lost.

I was thinking I could compress my home directory and be done with it, but when I did a google search I saw something about “rsync”.

I’m sure I’ll research it some more, but what is a good system for backing up in Linux? What do you do?

What I’m going to want to do soon is repartition my drive and make the Windows partition really small and the rest a Linux one, so I’ll have a chance toput the system to the test :slight_smile:.[/quote]

Most of your individual settings are in your home directory in the form of hidden files and directories all starting with a dot, like .kde, .mozilla, etc. You could get a listing of them like this:

==============================

ls -d .[a-zA-Z]*

.AbiSuite .gconf .mailfilterrc .tecla
.DCOPserver_sonic_:0 .gconfd .mcop .thumbnails
.DCOPserver_sonic__0 .gftp .mozilla .tzap
.ICEauthority .gimp-2.2 .mplayer .wine
.Xauthority .gnome .muttrc .wmrc
.Xdefaults .gnome2 .nano_history .xcdroast
.acrorc .gnome2_private .nautilus .xcin
.bash_history .gnupg .nessus.keys .xemacs
.bash_profile .gqview .nessusrc .xfce4
.bashrc .gramps .openoffice .xfdeskmenurc
.calendar .gstreamer-0.8 .procmailrc .xfwm4rc
.cddb .gtkrc .qt .xine
.config .gtkrc-2.0 .recently-used .xinitrc
.czap .htoprc .registry .xmms
.dillo .icewm .saves-27023-sonic .xpde
.dmrc .kaxtv .spamassassin .xscreensaver
.emacs.d .kde .ssh .xsession-errors
.fetchmailrc .kderc .sversionrc .zshrc
.fetchyahoorc .larswmrc .sylpheed
.fonts.cache-1 .links .szap

=================================

If you just want to back up these files/directories, you could do it with a single command:

tar -cvf myfiles.tar .[a-zA-Z]*

This will create a file “myfiles.tar” which you could copy to a CDR or some other backup media. To restore these files, you’d place the tar file in your new home directory, and type this:

tar -xvf myfiles.tar

Tar files can be compressed. Same syntax, but add a “z” option, and name the archive *.tar.gz:

tar -zcvf myfiles.tar.gz .[a-zA-Z]*

And to restore:

tar -zxvf myfiles.tar.gz

Of course, if all your data files will fit onto a 700MB CDR, you could just make an ISO of your home directory and burn a CD. No need to create a tar archive.

Hope this doesn’t sound too muddled.

cheers,
DB

P.S. There is some nice point and click backup software around for Linux, but I’ve never used it - “tar” is kind of old Unix, but it works.

I like rsync. If you have another linux, os x, or unix like system, you can copy to another computer.

I used to use tar and rsync exclusively on my Mac. With cron, it’s great and automated.

I use tar though for preference files and stuff. Here’s part of my script:

            pushd /etc
            sudo tar cfzphv ~/.backup/xetc.tgz \
                    --exclude-from=/Users/gary/.bin/tarx-x \
            csh.* ftpusers host* inetd.conf \
            smb* ssh* sudoers* xinetd*
            popd

You can list exclusions for tar with --exclude-from.

These days I like real backup programs with GUIs. Much easier. :slight_smile:

There are at least a few backup programs for linux. I forget their names but you can easily find them in any good linux book. If I were off work, I’d look them up for you.

I’m still looking for a good way to backup. I’ve used Veritas BackupExec. You could use NetBackup but I doubt you want enterprise-class backup that’d cost you a ton.

On Windows and Mac, I haven’t seen many easy to use powerful backup programs. I get by with what’s available but I don’t like it. Whatever’s available on linux is probably pretty cumbersome.

Whatever you choose, if you want the power to backup anything easily in real-time, it could take some work to setup.

I’ll eventually go with some SAN backup like Snap Server or something on OS X or linux. Now I need at least one terrabyte and something that’ll grow.

I want real-time networked backup from whereever I am: at home, at work, at a cafe. I want to backup through VPN or another secure method. I want versioning too. For that, I’ll go with Perforce or subversion for now.

If you’re hardcore into IT, I can recommend something. This summer I’ll probably get a Mac Mini and a firewire RAID for backup and all this stuff. A lot of what I’ll setup applies to linux if you want to go a similar route.

I was using Acronis True Image in Windows: acronis.com/ .

I don’t need anything really serious. It’s mostly the small data stuff I want to have current back ups of. Bringing Linux to full working order is much less of an ordeal than it is with Windows. 25 minutes BAM! I’m online with Skype. Reinstalling Windows is can be a few hours :P.

One terrabyte :astonished: , was that a typo? That’s a lot of space. I have a friend at home with 600+gigs RAIDed up all nice. I might get an online back-up service for my websites, but I think I can just setup an FTP server at home that’ll do the same thing.

I just looked in my LAMP book and they tell you how to make a script that does incremental back ups and delete back-ups older than 30 days (or something like that), with the tar command.

Boy is backing up fun :smiley:

It didn’t take too much Googling to find a decent article on the issue:

kmself.home.netcom.com/Linux/FAQs/backups.html

In the end, tar and rsync are probably best, unless you want to buy a commercial GUI utility.

cheers,
DB

[quote=“miltownkid”]
One terrabyte :astonished: , was that a typo? That’s a lot of space. I have a friend at home with 600+gigs RAIDed up all nice. I might get an online back-up service for my websites, but I think I can just setup an FTP server at home that’ll do the same thing.

Boy is backing up fun :smiley:[/quote]

one terrabyte. :slight_smile: I can get by with a few hundred megs for now. I can even get by with less than a 100 if I just want to back up my current work. I have other stuff, plus 250+ megs of music.

tar and rsync are great if you just want backup or syncing. Setup private keys on SSH and it’s secure from anywhere.

It won’t be atomic. If the sync doesn’t finish, it won’t revert so you’ll have some old files and new files. Though I’ll probably use tar and rsync for now.

if you want revisions so you can go back, you’ll need better backup. For just my work, I’m gonna use Perforce. It’s free for 2 users. It’s a Software Configuration Management app like CVS or subversion; it’ll work for what I need: group acess to files and version control.

Take a look at any good linux/unix admin or security book. It’ll be the quickest way to see what’s going on with backup. My unix skills have been pretty stagnant for a while; I haven’t had to do hardcore IT or even admin my own powerbook or a linux server for a long time.