Understanding Backup Archives

Hi there,

Is it possible to manually retrieve single files from a virtual server’s home directory within a backup archive?

This is what’s in my bz2 archive:

-rw-r–r-- 1 root root 57M 2008-01-02 22:48 mydomain.com_dir
-rw-r–r-- 1 root root 405 2008-01-02 22:48 mydomain.com_dns
-rw-r–r-- 1 root root 165 2008-01-02 22:48 mydomain.com_logrotate
-rw-r–r-- 1 root root 0 2008-01-02 22:48 mydomain.com_mail
-rw-r–r-- 1 root root 126 2008-01-02 22:48 mydomain.com_mail_aliases
-rw-r–r-- 1 root root 2 2008-01-02 22:48 mydomain.com_mail_cron
-rw-r–r-- 1 root root 286 2007-09-12 04:18 mydomain.com_mail_plainpass
-rw-r–r-- 1 root root 586 2008-01-02 22:48 mydomain.com_mail_users
-rw-r–r-- 1 root root 0 2008-01-02 22:48 mydomain.com_mysql
-rw-r–r-- 1 root root 181K 2008-01-02 22:48 mydomain.com_mysql_database_mydomain.gz
-rwxr-xr-x 1 root root 278 2008-01-02 22:48 mydomain.com_spam
-rw-r–r-- 1 root root 0 2008-01-02 22:48 mydomain.com_spam_auto
-rw-r–r-- 1 root root 10K 2008-01-02 22:48 mydomain.com_spam_cf
-rw-r–r-- 1 root root 1.9K 2008-01-02 22:48 mydomain.com_virtualmin
-rw-r–r-- 1 root root 59K 2007-09-24 01:31 mydomain.com_virtualmin-awstats
-rw-r–r-- 1 root root 2.5K 2008-01-02 22:00 mydomain.com_virtualmin_bw
-rw-r–r-- 1 root root 0 2008-01-02 22:48 mydomain.com_virtualmin_scripts
-rw-r–r-- 1 root root 912 2008-01-02 22:48 mydomain.com_web
-rw-r–r-- 1 root root 30K 2008-01-02 22:48 mydomain.com_webmin

The size of mydomain_dir corresponds to the original apache public directory, but I can’t use that file in the raw format.

Some additional documentation on the internals of the backup process would be very much appreciated.

Cheers, Nick<br><br>Post edited by: nick108, at: 2008/01/02 12:01

If it’s a directory it is tarred. If it’s a file, it’s just a file (though it may need further processing to make it useful, in the case of the Apache configuration, Webmin configuration, mail users, and MySQL users). I believe this is true all around.

So, you can untar the master archive:

tar zxvf domain.tld.tar.gz

or:

tar jxvf domain.tld.tar.bz2

And then:

tar xvf domain.tld_dir

The regular files can be viewed exactly as is using your favorite text editor. Virtualmin knows where they all go, of course, but they could also be restored manually–though you’d need to dig a bit to figure out where they go (some are for subdirectories of /etc/webmin/virtual-server, some are for injection into the Apache configuration, Postfix virtual map file, etc.) Some might even be Perl data structures dumped with Data::Dumper or some other serialized form (I’m just guessing…haven’t looked deeply into the backup format in ages, since I haven’t run into any problems that required it–the backup/restore is pretty reliable and flexible these days).

Thanks for the quick reply, Joe.

Almost all files in the backup archive are flat config files or e.g. a mysql dump, but the domain.tld_dir file is confusing me. Maybe because it’s serialized as you mentioned. Is there an easy way (outside of VM) to convert the domain.tld_dir file into it’s original folder and file structure? Is there a command line utility that can do this. I’m not a perl bunny and therefore I’m a bit hesitant to dive deeper into the Data::Dumper method.

You must have gotten an answer to this a long time ago, but it seems

tar xf domain.tld_dir would pull everything out of that tar file and recreate all the directories with files in it.