0

I was having a discussion recently regarding the fact that *nix doesn't use things like a registry (in the Windows sense) and how this means that everything related to an application (or anything for that matter) sits directly in the filesystem.

This got me thinking: if I wanted to backup an application install, is snapshotting the appropriate directories sufficient? The purpose here would be to allow me to wreck havoc on an application knowing that I can quickly roll back to a known good state.

2 Answers 2

4

You'll probably realize that most *nix applications spread their files around the filesystem, such as /usr/bin for the binaries, /usr/share for the documentation, /etc for the configs, and /var for the data files.

Most *nix contain some kind of package management, of various capabilities. DPKG and RPM-based distros have a database containing all the files deployed when the application was installed, which could conceivably be used for this kind of purpose. However, this won't cover any files that the application creates itself on run-time, such as user preferences.

I don't think you'll find a foolproof way to do it, but package management should give you something to start with.

2
  • 1
    If your system doesn't have package management the best thing to do is install the app into its own directory (for apps that use autoconf you can do this by specifying --prefix=/opt/application to the configure script), that way you can back up that directory and grab everything (plus or minus libraries that it links to & files created outside that path later
    – voretaq7
    Feb 17, 2010 at 3:13
  • I infer from your answer that provided I exercise due care a filesystem-level snapshot of the appropriate directories would suffice as a backup?
    – LRE
    Feb 17, 2010 at 3:37
0

My experience has been that the configuration files are in one place, and as long as you backup that one place, restoring the application works fine.

For user applications, that one place is usually the user's home directory.

For server application, you read the man or info page to find out where the application stores its config, and then you back that up. Usual locations are in /etc or in a sub-directory of /usr.

Porting app configurations between different physical, or even virtual, machines, has generally been pretty easy. Install the app, and then overwrite the config file or config directory in the new target.

Compared to Windows, my personal experience is that restoring configuration settings is much easier in practice on Unix-style systems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .