A
Andy Signer
Hi,
tonight I was searching for a script to extract *.raq files. I wasn't
able to get one on the inet. The only thing I found was the script
written by Jeff Bilicki for RaQ2. I customised it for RaQ 4. May it be
helpful to others.
Here it comes (quick 'n dirty)!
Have fun ;-)
Andy
#!/usr/bin/perl
# Andy Signer <blackhole at diediedie.org>
# removes the header out of a RaQ 4 backup file (*.raq) and write a
# normal tar.gz archive
#
# Original version by:
# Jeff Bilicki <jeffb at cobaltnet.com>
# removes the header out of a RaQ 2 backup file
###############################################################################
use strict;
my $infile;
my $outfile = "out.tar.gz";
my $header_start ="\%\%BACKUP_HEADER";
my $header_end = "\%\%END_XML";
if (@ARGV) {
$infile = $ARGV[0];
} else {
print "usage: stripheader.pl <file name>\n";
exit 1;
}
open (INFILE, $infile) or die "Can't open: $!\n";
open (OUTFILE, ">$outfile") or die "Can't open $!\n";
while (<INFILE>) {
if ( /^$header_start/ ... /^$header_end/ ) {
next;
}
print OUTFILE $_;
}
close(INFILE);
close(OUTFILE);
exit 0;
tonight I was searching for a script to extract *.raq files. I wasn't
able to get one on the inet. The only thing I found was the script
written by Jeff Bilicki for RaQ2. I customised it for RaQ 4. May it be
helpful to others.
Here it comes (quick 'n dirty)!
Have fun ;-)
Andy
#!/usr/bin/perl
# Andy Signer <blackhole at diediedie.org>
# removes the header out of a RaQ 4 backup file (*.raq) and write a
# normal tar.gz archive
#
# Original version by:
# Jeff Bilicki <jeffb at cobaltnet.com>
# removes the header out of a RaQ 2 backup file
###############################################################################
use strict;
my $infile;
my $outfile = "out.tar.gz";
my $header_start ="\%\%BACKUP_HEADER";
my $header_end = "\%\%END_XML";
if (@ARGV) {
$infile = $ARGV[0];
} else {
print "usage: stripheader.pl <file name>\n";
exit 1;
}
open (INFILE, $infile) or die "Can't open: $!\n";
open (OUTFILE, ">$outfile") or die "Can't open $!\n";
while (<INFILE>) {
if ( /^$header_start/ ... /^$header_end/ ) {
next;
}
print OUTFILE $_;
}
close(INFILE);
close(OUTFILE);
exit 0;