1 |
#!/usr/local/bin/perl |
#!/usr/bin/perl |
2 |
|
|
3 |
use strict; |
use strict; |
4 |
#use lib "__INSTALLDIR__/lib"; |
use lib "__INSTALLDIR__/lib"; |
|
# FIXME |
|
|
use lib "/data/backuppc/lib"; |
|
5 |
|
|
6 |
use DBI; |
use DBI; |
7 |
use BackupPC::Lib; |
use BackupPC::Lib; |
60 |
my $output = new IO::File(">$filename"); |
my $output = new IO::File(">$filename"); |
61 |
my $writer = new XML::Writer(OUTPUT=>$output, NEWLINES => 1); |
my $writer = new XML::Writer(OUTPUT=>$output, NEWLINES => 1); |
62 |
|
|
63 |
|
$writer->pi('xml-stylesheet', 'href="archive.css" type="text/css"'); |
64 |
|
|
65 |
my $files_sql = q{ |
my $files_sql = q{ |
66 |
SELECT |
SELECT |
67 |
files.path AS path, |
files.path AS path, |
116 |
$sth_files->execute($row->{'backup_id'}); |
$sth_files->execute($row->{'backup_id'}); |
117 |
|
|
118 |
delete($row->{'backup_id'}); |
delete($row->{'backup_id'}); |
119 |
|
$row->{'date'} = strftime($t_fmt,gmtime($row->{'date'})); |
120 |
|
|
121 |
$writer->startTag( "backup", %{$row} ); |
$writer->startTag( "backup", %{$row} ); |
122 |
|
|
123 |
while (my $row = $sth_files->fetchrow_hashref()) { |
while (my $row = $sth_files->fetchrow_hashref()) { |
124 |
# convert filetype to string |
# convert filetype to string |
125 |
$row->{'type'} = BackupPC::Attrib::fileType2Text(undef, $row->{'type'}); |
$row->{'type'} = BackupPC::Attrib::fileType2Text(undef, $row->{'type'}); |
126 |
|
$row->{'date'} = strftime($t_fmt,gmtime($row->{'date'})); |
127 |
my $path = $row->{'path'}; delete $row->{'path'}; |
my $path = $row->{'path'}; delete $row->{'path'}; |
128 |
|
|
129 |
$writer->startTag("file", %{$row}); |
$writer->startTag("file", %{$row}); |
271 |
|
|
272 |
} |
} |
273 |
|
|
274 |
# FIXME add file list in xml and txt and note file |
# add file list and note in xml |
|
|
|
275 |
dumpArchive2XML($dbh, $dvd_nr, $xml_file); |
dumpArchive2XML($dbh, $dvd_nr, $xml_file); |
276 |
print $list "$xml_file\n"; |
print $list "$xml_file\n"; |
277 |
|
|
278 |
|
# add css file for archive |
279 |
|
my $css_file = $Conf{CgiImageDir} . '/archive.css'; |
280 |
|
if (-r $css_file) { |
281 |
|
print $list "$css_file\n"; |
282 |
|
} else { |
283 |
|
print "WARNING: missing $css_file, not added to iso image!\n"; |
284 |
|
} |
285 |
|
|
286 |
close($list); |
close($list); |
287 |
|
|
288 |
print "Running mkisofs now for $inc increments...\n"; |
print "Running mkisofs now for $inc increments...\n"; |