On Sun, Apr 27, 2008 at 12:18:45PM -0700, Robin Lee Powell wrote:
> As a workaround, you can remove the file from the filemap.
> 
> Here's some Perl to remove a file from the filemap; I'm afraid I've
> made no attempt to make it user friendly.

Here's a better version.  It walks the entire filemap, and if any
file fails to stat, it deletes that line *and* the encrypted version
of the file.

Run it like this:

/var/tmp/rsyncrypto_filemap_fix.pl [orig filemap] [new filemap] \
    [source dir for unencrypted files] [dest dir for encrypted files]

(As you can see, I'm willing to help out with code :)

-Robin

-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
#!/usr/bin/perl -0

# The filemap
my $infile=$ARGV[0];
# The new filemap
my $outfile=$ARGV[1];
# The location of the original files
my $prefix=$ARGV[2];
# The location of the encrypted files
my $encprefix=$ARGV[3];


open( MAP, "<$infile");
open( FM, ">$outfile");

while (<MAP>) {
    m{^/([0-9A-F])([0-9A-F])([0-9A-F])([0-9A-F])([0-9A-F])([0-9A-F]+)\s*(.*)$};

    my $file="$prefix/$7";
    chomp $file;
    my $encfile="$encprefix/$1/$1$2/$1$2$3/$1$2$3$4/$1$2$3$4$5/$1$2$3$4$5$6";
    if( stat $file )
    {
	print FM;
    } else {
	print "broken: $file -- $encfile\n";
	#print `ls -l '$file'`;
	#print `ls -l '$encfile'`;
	unlink $encfile;
    }
}
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Rsyncrypto-devel mailing list
Rsyncrypto-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsyncrypto-devel

Reply via email to