mehulashara / vmfs

Automatically exported from code.google.com/p/vmfs
0 stars 0 forks source link

No method for recursive copy or update/freshen. #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. try and copy more then 1 file, say an entire lun
2. using r95, on CentOS 6.0, webdav fails badly.

However, copying the files using the filecopy command works fine.

What is the expected output? What do you see instead?
Attempting to use filecopy to copy a path, doesn't work so well

What version of the product are you using? On what operating system?
R95 on CentOS 6.0 x86, using OpenJDK 1.6.0

Please provide any additional information below.
I solved this with a kludge of a perl script, in ~10 min. Still wish there to 
be an actual method for recursive copying, and or update/freshen...

==============
#!/usr/bin/perl
use strict;
use warnings;

my ($filematch, $dirmatch, $true, $logfilename, $destdir, $vmfslocation, 
$jarfiles);

$logfilename  = "filename.txt";
$destdir      = "/mnt/456";
$vmfslocation = "/dev/mapper/vmstore-vmstore";
$jarfiles     = "/root/vmfs_r95";

my @filelist = `java -jar $jarfiles/fvmfs.jar $vmfslocation dirall / | grep -v 
"dir"`;

open (FILEOUT, ">>$logfilename");
foreach my $file (@filelist) {
        $true = 0;
        if ($file =~ m/(recur)/) {
                next;
        }
        if ($file =~ m/((?<=\s)\/.*\/.*)/) {
                $filematch = $&;
                $true++;
        }
        if ($file =~ m/((?<=\s\/).*(?=\/))/) {
                $dirmatch = $&;
                $dirmatch =~ s/\s/\\ /;
                $true++;
        }
        if ($true == 2) {
                my $newdir = "$destdir/$dirmatch";
                if (-d $newdir) {
                } else {
                        `mkdir $newdir`;
                }
                chdir $newdir;
                my $copy = `java -jar $jarfiles/fvmfs.jar $vmfslocation filecopy $filematch 2>&1`;
                print FILEOUT "$filematch:\n";
                print FILEOUT "$copy\n";
        }
}

close (FILEOUT);
=================

Original issue reported on code.google.com by garrett...@gmail.com on 11 Aug 2011 at 9:32