Home » Questions » Unexperienced [ Ask a new question ]

Ubuntu: Should I backup the entire home directory?

Ubuntu: Should I backup the entire home directory?

"Does it make sense to backup the entire /home directory? Or should I selectively backup the config files I want to retain?

If I reinstall the OS, is it safe to use the previous /home directory if it's the same distro?"

Asked by: Guest | Views: 56
Total answers/comments: 3
Guest [Entry]

"Absolutely. It makes perfect sense to backup your whole home directory.

I'd only recommend restoring the entire directory if it's the same version of the same distribution. If you're restoring to a different version, extract individual config files from your backup as needed.

I'd restore Firefox profiles, Vim config files, bash config files & aliases, and (probably) my ~/bin directory -- but I wouldn't restore Gnome config files. I'd let the new Gnome version create config files from scratch and then apply changes a few at a time.

YMMV, though, and if something blows up after you restore your entire home directory, it's not too hard to remove your config files and let programs recreate them the next time they run."
Guest [Entry]

"I can tell from the question you're a newbie to this sort of thing... Over the holidays I just retooled my backup / archival / recovery strategy that I've had in place for FOURTEEN years. Here's some great advice...

First, Richard Marquez has it right - another partition, but I have simplified this and standardized it for my use - here you go:

The directory ""slash el"", /l, is where the ""local"" things go that I care about. Nothing that's a part of the operating system goes here.

The directory /nfs is where all ""foreign"" file systems get mounted, and subdirectories for each host are underneath - and under that is where that system's ""slash el"" directories go.

Disk space - ALL - non-system disk space goes under /d with a mount point per disk as in:


These disks then contain whatever. Your /l directory then links to these places. For example, music might be in /d/d3/Music, and /l has then /l/Music. You can them move Music around when needed and just change the link. The link is made with ln, for example:

ln -s /d/d3/Music /l/Music

The point here is to organize in advance using a pattern that's easy to remember and easy to manage. When you get new disks, you already have a place to put them and you already have a way to move data between them simply and easily. AND you know where the ""primary"" copy is, because, in my example, it's under /l.

Now, for backups, put them on their own spindle, say /d/d2/Backups. Now you have a link /l/Backups, so you never have to worry what spindle the data's on. Under that you have a place for zip files and tars if you like, say /l/Backup/zip. But, vitally, I also use a place I call ""sync"" and this is where things get really useful...

If you have a directory under /l/Backups/sync for each directory under /l except Backups, you can then use this fantastic tool called rsync. It's so useful I can only introduce you to it here... You then synchronize your backup space with rsync with something like:

rsync /l/Music /l/Backups/sync

Under /l/Backups/sync, you'll then have a directory called Music that contains THE ENTIRE TREE, and not in a zip but as live files. Further, rsync is so smart, it only touches the things that have changed so it's very efficient. You can synchronize huge trees in a matter of minutes, depending on the changes. It will even delete deleted files if you want so the trees remain EXACTLY the same, including permissions, timestamps, etc.

I have found this so useful, I have created a backup script which uses all my favorite flags and keeps me from having to even think about it - just call the script and it makes it happen.

Rsync is designed to help you synchronize disks ACROSS SYSTEMS, and it knows how to use SSH, so you can kee REMOTE disks synchronized, too - great for disaster recovery!

Hope this helps... There's a lot possible - take a word from the wise: Keep all your own stuff completely separate from the operating system and back the OS up separately. If you are using Unix or Linux, all you really need is /etc. There shouldn't be much else... DO NOT LET YOUR STUFF GET MINGLED WITH THE OS!"
Guest [Entry]

"Being a bit pickier than just making a backup of the whole home directory has some advantages:

you will learn that sometimes you might need a couple of versions of the same config/source code file, which will push you toward storing such data by using an intermediate layer - a Source Code Management tool and creating a backup of the repository
you will learn that there are things in your home directory that you certainly wouldn't want to backup. For example the cache directory from your Firefox profile."