our @EXPORT = qw(update_some_files create_many_files check_multiple_copies
update_client $HOST $BASEPORT add_to_backup_list check_volume_size
check_min_volume_size check_max_volume_size $estat $bstat $rstat $zstat
- $cwd $bin $scripts $conf $rscripts $tmp $working
+ $cwd $bin $scripts $conf $rscripts $tmp $working extract_resource
$db_name $db_user $db_password $src $tmpsrc);
$estat = $rstat = $bstat = $zstat = 0;
}
+sub extract_resource
+{
+ my ($file, $type, $name) = @_;
+
+ open(FP, $file) or die "Can't open $file";
+ my $content = join("", <FP>);
+
+ if ($content =~ m/(^$type {.+?Name\s*=\s*"?$name"?.+?^})/ms) {
+ print $1, "\n";
+ }
+
+ close(FP);
+}
+
sub check_min_volume_size
{
my ($size, @vol) = @_;