|
From: G.W. H. <ba...@ju...> - 2026-05-05 16:10:06
|
Hi there, On Mon, 4 May 2026, bac...@su... wrote: > The host running backuppc on my network had its root drive fail. :( > The actual backup storage was on an external drive which I had > mounted on /var/lib/backuppc. That external drive is still healthy. :) > I remember spending a lot of time getting backuppc to work just > right and dread starting over. My early recollections are similar but I wrote it all in my notebook. It's a habit I developed in my first job - at an explosives research laboratory in 1971. It's a habit I've kept up ever since, and over the years it's sometimes been incredibly useful. > Since the external drive includes the backup for localhost (the > former box running backuppc), it should include a backup for > /etc/backuppc and the config.pl file (I forget which directories I > set for backup for localhost; hopefully I included /etc). Hopefully. Hmmm. > It seems there should be a way I can extract my now-lost > /etc/backuppc/config.pl and other files in that directory. I am > hoping I can install backuppc fresh, then grab the /etc/backuppc > files from the external drive, and swap them in. Is this possible? Hopefully. If you didn't back up the files, they're probably gone. You didn't say what version of BackupPC you're using, so I assume V4. First I suggest that you make a copy of your backup drive on another medium of some sort. Put that copy somewhere safe. Next install a new version of BackupPC the same way that you installed it originally, for example if you used a distro package use the same distro package. At this stage don't try to connect the old backup drive (nor the copy) but simply get the BackupPC system working. You can use any old host on the network as a dummy to start making backups. To get you started set up the configuration to back up one file on it, say every hour or something like that. Once you have the new BackupPC working, shut it down - so that now the BackupPC script isn't running. Now edit the BackupPC 'hosts' file so that it contains the hosts that you had on the original system (if you can't remember them, the hostnames are the names of directories in the directory .../pc/ of the BackupPC backup data store). At this point, if you started BackupPC, it could try to start backing up your hosts. Presumably you won't want it to do that because you'll have individual configurations (for example in /etc/backuppc/pc/ [*]) for each of your hosts, and before starting the backups you'll want to get those configuratons from a backup. You can do that as follows: Replace the 'new' backup store with your 'old' backup store. I'll let you work out how to do that, from what you've written you're obviously capable of doing it. When you've done it, you *could* start BackupPC, but you still don't want to start backups - you still don't have your old configurations. However, you *can* now use the tools provided by BackupPC to get files and directories from the backup data store... 'BackupPC_ls' lets you list the files in any directory from any backup of any share of any host. It gives you an md5sum for each file listed. Here's an example, where I'm logged in as root on the backup server: 8<---------------------------------------------------------------------- # su -c "/usr/local/BackupPC/bin/BackupPC_ls -h alpha -n 2235 -s Config /" backuppc /: -rw-r--r-- 0/0 290 2019-09-26 01:24:33 /.fstab (0416cfcbe01474d6f0526ffa5d890813) drwxr-xr-x 0/0 0 2020-05-07 15:45:30 /.java/ -rw------- 0/0 0 2019-09-26 01:05:24 /.pwd.lock (d41d8cd98f00b204e9800998ecf8427e) drwxr-x--- 0/1002 0 2026-03-26 13:55:12 /BackupPC/ drwxr-xr-x 0/0 0 2025-02-01 16:36:24 /ImageMagick-6/ ... ... 8<---------------------------------------------------------------------- As you can see, BackupPC_ls (normally) has to be run under the ID of the backup user, usually 'backuppc' but of course that's configurable. You give it the host name, in this case 'alpha', the backup number, in this case 2235, the share name, in this case 'Config', and the name of the directory that you want to list, in this case '/'. The output is a bit like that from 'ls -l' but you get md5sums for the files (not for directories). In my example above I've given the full path to the BackupPC_ls utility, it will likely be different in your installation. If you can't remember the share names, they're in the numbered backup directories under the host name directory with 'f' prefixed to them. The file 'backups' in the top level of the host's directory shows you which backup numbers are full and which are incremental. 'BackupPC_zcat' then lets you write the content of any file to stdout. You just give it the md5sum which BackupPC_ls provided for your file. Below I've recovered the file '.fstab' which has the md5sum '0416cf...': 8<---------------------------------------------------------------------- # su -c '/usr/local/BackupPC/bin/BackupPC_zcat 0416cfcbe01474d6f0526ffa5d890813' backuppc proc /proc proc defaults 0 0 PARTUUID=6c586e13-01 /boot vfat defaults 0 2 PARTUUID=6c586e13-02 / ext4 defaults,noatime 0 1 PARTUUID=6c586e13-03 /var ext4 defaults,noatime 0 1 # 8<---------------------------------------------------------------------- You can redirect stdout to a file of course. That's all there is to it. > The names on the files on the external drive are all user-unfriendly. A consequence of BackupPC's way of de-duplicating things is that the files in the backup data store don't have the names that they have on the backed-up storage devices. The name of a file is the md5sum of the files's content, with the added wrinkle that the file in the data store will probably be compressed. The pseudo-filesystems under the BackupPC host name directories index into the data store using md5sums as pointers. The pool files are split into 128 subdirectories, each of which is further split into 128 subdirectories, so that for example my file '.fstab' 0416cfcbe01474d6f0526ffa5d890813 is stored in .../cpool/04/16/0416cfcbe01474d6f0526ffa5d890813 as you can see: 8<---------------------------------------------------------------------- # ls -l /var/lib/BackupPC/cpool/04/16/0416cfcbe01474d6f0526ffa5d890813 -r--r--r--. 1 backuppc backuppc 117 Apr 21 14:09 /var/lib/BackupPC/cpool/04/16/0416cfcbe01474d6f0526ffa5d890813 # 8<---------------------------------------------------------------------- The file size in the store is only 117 bytes because it's compressed, if I extract it using BackupPC_zcat I can see the actual file size on the real storage medium (it was given by the BackupPC_ls output above): 8<---------------------------------------------------------------------- # su -c '/usr/local/BackupPC/bin/BackupPC_zcat 0416cfcbe01474d6f0526ffa5d890813' backuppc | wc -c 290 8<---------------------------------------------------------------------- HTH - and I hope the longer lines didn't wrap on your mail client. [*] This would be /etc/BackupPC/pc if you installed from source, so I'm guessing that you used a distro package e.g. Debian to install. In my view, their almost universal insistence on e.g. changing the names and locations of files and directories tends to make things a lot more difficult for everybody. -- 73, Ged. |