I'm removing my Ubuntu 13.04 as I'm reinstalling latest version. So, I have taken back up of my home partition using tar. The back-up includes hidden files (dot files) like below:

$ tar -tvf ubuntu_home.tar

drwxr-xr-x ravbholua/ravbholua 0 2014-06-08 16:11 home/ravbholua/
drwx------ ravbholua/ravbholua 0 2013-07-04 04:41 home/ravbholua/.compiz/
drwx------ ravbholua/ravbholua 0 2014-06-07 13:27 home/ravbholua/.compiz/session/
-rw-rw-r-- ravbholua/ravbholua 94 2013-07-17 21:09 home/ravbholua/.compiz/session/10cb5b0e6473b31966137407039559636600000017000031
-rw-rw-r-- ravbholua/ravbholua 94 2014-03-30 23:13 home/ravbholua/.compiz/session/10827bd50247533452139619877576376200000017730032
-rw-rw-r-- ravbholua/ravbholua 94 2014-03-26 17:58 home/ravbholua/.compiz/session/1045273c9617fd9fd4139583223634115900000020210032
-rw-rw-r-- ravbholua/ravbholua 93 2013-07-18 19:07 home/ravbholua/.compiz/session/103af463f1638372f413741493305265900000017040031
-rw-rw-r-- ravbholua/ravbholua 94 2013-10-02 21:14 home/ravbholua/.compiz/session/10731c70d9dfbc841d138072379649671100000018220032
-rw-rw-r-- ravbholua/ravbholua 94 2013-07-25 21:20 home/ravbholua/.compiz/session/10178ce07333091a04137476677623131400000017150031
drwx------ ravbholua/ravbholua         0 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/log/
-rw------- ravbholua/ravbholua         0 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/log/dummy
-rw------- ravbholua/ravbholua        42 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/log/festi
-rw------- ravbholua/ravbholua         0 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/log/espea
drwx------ ravbholua/ravbholua         0 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/log/debug
-rw-rw---- ravbholua/ravbholua      7522 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/log/speec
drwx------ ravbholua/ravbholua         0 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/pid/
-rw-rw---- ravbholua/ravbholua         5 2014-01-09 08:52 home/ravbholua/.speech-dispatcher/pid/speec
drwx------ ravbholua/ravbholua         0 2013-07-16 20:47 home/ravbholua/.synaptic/
-rw-rw-r-- ravbholua/ravbholua       237 2013-08-19 08:53 home/ravbholua/.synaptic/synaptic.conf
-rw-rw-r-- ravbholua/ravbholua         0 2013-08-19 08:53 home/ravbholua/.synaptic/options
-rw-rw-r-- ravbholua/ravbholua         0 2013-09-03 19:01 home/ravbholua/.Xauthority.IJTU2W
-rw-r--r-- ravbholua/ravbholua     12679 2013-07-04 03:14 home/ravbholua/.face

What I feel is it's not required to take-up back up of all these files. Rather it may be dangerous to back-up these dot files. Are they really needed? When I reinstall the new Ubuntu, then my home partition may have many dot files (I suppose). I may like to recover the backed-up files in the home partition of the new OS. So while recovering (say using tar), the already existing dot files will be overwritten by the backed up files which may be dangerous. Because my intention would be to recover the files (pdf, audio/video, text, etc from my home partition) that I had intentionally created & not the dot files which automatically gets created.

So, how to back-up my home partition?


Only back up things that you understand the purpose of.

For example, if your email client has a specific configuration file, you probably want to save that. Of course, while your email client almost certainly does have somewhere it saves configuration, if the configuration is set through the interface, you may not know what where that is. You could try to make some guesses in this regard, but do not simply assume everything in a ~/.mymailclient directory is for configuration.

Unfortunately, it seems to be the norm with contemporary software to blackbox configuration without implementing or documenting a means for the user to back this up or transfer it to another system. For such cases you might hunt around online to see if someone has a clue. You could also try getting on the user mail list and asking.

how to back-up my home partition?

Rather than completly automating the process with tar, I recommend you create a "backup" directory and copy everything you want into it, mirroring the directory structure of your home directory, then create a tarball of that. As you may or may not be aware, you can unpack a tarball inside an existing directory and everything will fall into place without deleting existing files; e.g., if there is an existing subdirectory foo and a file in the archive foo/bar, it will be placed into the existing foo subdirectory, replacing any existing bar, but not changing anything else about the directory. In other words, unpacking a tarchive is additive, so you can take your backup tarball, unpack it in the new $HOME, and the files inside will be added to whatever is already there.

However, if you want to experiment with backing stuff up, you could instead unpack it into a fresh subdirectory and copy stuff out one app at a time. For example, once you install your email client and start it once, you will probably have a directory containing the configuration, e.g., ~/.myemailclient. You can then tar that temporarily and copy the stuff from your backup in. If the app still works properly, great. If not (the nature of the configuration may have changed across versions, or you may have guessed wrong about what the files involved do, etc.), you can delete it and go back to the original from the temporary archive of that (alternately, you could create a second backup directory and copy the fresh system configs into there until you are happy with everything).

This way you can try to backup as much configuration as you can without risking leaving anything on the new system in an inconsistent state.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.