Hi,
Phil Kennedy wrote on 2013-03-20 21:28:52 -0400 [Re: [BackupPC-users] Stop
TrachClean / Return directories backup list]:
> On 3/20/2013 9:12 PM, Holger Parplies wrote:
> > [...]
> That's very odd, but a possiblity. My thought was that the mdadm.conf
> was rebuilt when the Promise array was brought online, and the previous
> admin simply omitted the old RAID confs for sda and sdb. From that point
> on, sda booted as a normal drive rather than a RAID member and no one
> was the wiser.
I'm not sure under which conditions the kernel automatically assembles an
array. Concerning the root FS, the kernel command line parameter should give a
reasonable hint. It's either 'root=/dev/md0' (or similar), then booting should
fail if it's not (and can't be) assembled, or it's 'root=/dev/sda1', which
should be a problem even *if* the array is assembled :-).
> As an aside, i've seen drives in other backuppc / software RAID
> instances fail for no good reason, to the point that they pass long
> smartctl test, yet mdadm is still convinced that the drive is bad.
> Perhaps the vibration issue you've described was the culprit then?
In my case, I could simply re-add the device to the array. It wouldn't be
re-added automatically in any case.
> > Do the *hosts* show up in the web interface? If not, look at your hosts file
> > (/etc/BackupPC/hosts or something like that). If so, it could be
> They do now. One of the first things I did was to rebuild the hosts file
> based on the information in /backup/pc.
What I meant is: were you describing an *empty* host page (i.e. host page with
no backups) or a *missing* host page (i.e. host unknown to BackupPC)?
> > That should be unnecessary as long as BackupPC is not running. Err, does the
> > web interface work without a running BackupPC daemon?
>
> No, backuppc doesn't work without the daemon running.
That's funny. I consider "BackupPC" to be the daemon, not the web interface :-).
> The web interface
> makes troubleshooting at little easier for me, especially since I have a
> number of hosts to verify.
Yes, I can see that. I wouldn't want to interpret backup data from the command
line either.
> I can change the config files from terminal, but the web just makes it far
> prettier / simpler.
The thing is, it needs to work. Perhaps the daemon's understanding of which
backups exist and which don't is just fine (*), and it's only the web interface
that has problems. Either a problem with BackupPC or with the web interface
would cause the web interface to fail, so you need to fix both at once, rather
than one at a time. Ideally, one of us would write "BackupPC_ls" for you, so
you could list hosts and backups from the command line. Jeffrey, are there any
volunteers? ;-)
Actually, I seem to have written something vaguely similar in 2007 ... a quick
hack it was then, and it still is now, and it's almost certainly untested with
BackupPC 3.x, but you could give it a try. Should list the hosts and backups
BackupPC is aware of. Seems non-destructive enough, in any case.
Regards,
Holger
(*) Actually, the daemon doesn't care about existing backups; I should
probably write BackupPC::Lib instead. The web interface uses that, too,
but there's additionally the issue of the correct UID and perhaps
SELinux implications.
#!/usr/bin/perl -- -*- quick-hack -*-
#
# generate CSV output (actually, I'll use "|" as separator) for something
# like:
# hostname|date/time|size in MB|level|duration(min)
# almost as requested by John Rouillard.
# You might also want the backup number. See the comment below.
use lib '/usr/share/backuppc/lib'; # change to match your installation
use BackupPC::Lib;
use POSIX;
my $bpc = new BackupPC::Lib ('', '', '', 0)
or die "Can't create BackupPC object!\n";
my @hosts; # array of hosts
my $hostinfo; # pointer to hash of per host information
my @backups; # info on all backups of one host
my $dt; # output fields for loop iteration: date/time
my $size; # ... size
my $level; # ... level
my $duration; # ... duration in minutes
$hostinfo = $bpc->HostInfoRead ();
@hosts = sort keys %$hostinfo;
# print 'hosts =>', (join '<, >', @hosts), "<=\n";
host:
foreach my $host (@hosts) {
@backups = $bpc -> BackupInfoRead ($host)
or warn "Invalid hostname '$host' or other error!\n";
foreach my $backup (@backups ) {
# [-1] <- add that in the line above for only
# the most recent backup of each host
# exploring the data structure:
# print "$host=>", join (',', map { "$_=$backup->{$_}" } sort keys %$backup), "<=\n";
$dt = POSIX::strftime ('%Y-%m-%d %H:%M',
localtime $backup -> {startTime});
$size = int ($backup -> {size} / 1024 / 1024 + 0.5); # MB, rounded
$level = $backup -> {level};
$duration = int (($backup->{endTime} - $backup->{startTime}) / 60 + 0.5);
# printf "[%4d] %-20.20s %-16.16s %10d %3d %4d\n",
# $backup -> {num}, $host, $dt, $size, $level, $duration;
# ^^^^^^^^^^^^^^^^ Backup number. This is the comment below.
# (and yes, I've added it for the "2013 release" ;-)
print +(join '|', $backup -> {num}, $host, $dt, $size, $level, $duration),
"\n";
}
}
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/