/[BackupPC]/trunk/bin/BackupPC_burnArchiveCLI
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/BackupPC_burnArchiveCLI

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 188 by dpavlin, Wed Oct 12 16:49:02 2005 UTC revision 193 by dpavlin, Thu Oct 13 15:11:58 2005 UTC
# Line 1  Line 1 
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;
# Line 62  sub dumpArchive2XML($$$) Line 60  sub dumpArchive2XML($$$)
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,
# Line 116  sub dumpArchive2XML($$$) Line 116  sub dumpArchive2XML($$$)
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});
# Line 269  foreach my $arc (@archives_to_burn) { Line 271  foreach my $arc (@archives_to_burn) {
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";

Legend:
Removed from v.188  
changed lines
  Added in v.193

  ViewVC Help
Powered by ViewVC 1.1.26