[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-security] Back up and restore it



From: "Robbert Hamburg" <rhamburg@xxxxxx>

> Perhaps I didnot define my query right cause nothing comes up searching
for:
> backup and restore, tar.gx, .raq
> any suggestions or a location ?

I dug it out of my own archives. I know this works with my raq3i, but I
don't know if it works for raq4's, etc.

#######  PERL SCRIPT START ##########
#!/usr/bin/perl
# based on code by Jeff Bilicki <jeffb@xxxxxxxxxxxxx>
# modified by Ben Charlton <bencharlton@xxxxxxxxxxxx>
# support added for RaQ3 .raq backup files.
#
# This code removes the custom header information from the backup file.

use strict;

my ($infile);
my ($outfile);
my ($end) = "\%\%END_INDEX";
my ($begin) = "\%\%BACKUP_HEADER";
my ($end2) = "\%\%END_XML";
my ($begin2) = "\%\%BACKUP_XML";

if (@ARGV) {
$infile = $ARGV[0];
$outfile = $ARGV[1];
} else {
print "usage: strip.pl <file to clean> <output file>\n\nOutput file should
be a .tar.gz\n";
exit 1;
}

open (INFILE, $infile) or die "Can't open: $!\n";
open (OUTFILE, ">$outfile") or die "Can't open $!\n";

while (<INFILE>) {
if ( /^$begin/ ... /^$end/ ) {
next;
} else {
if ( /^$begin2/ ... /^$end2/ ) {
next;
} else {
print OUTFILE $_;
}
}
}
close(INFILE);
close(OUTFILE);
exit 0;

#######  PERL SCRIPT END ##########

Enjoy,
Kevin