On 19 November, 2012 - Jim Klimov sent me these 1,1K bytes:

> Oh, and one more thing: rsync is only good if your filesystems don't
> really rely on ZFS/NFSv4-style ACLs. If you need those, you are stuck
> with Solaris tar or Solaris cpio to carry the files over, or you have
> to script up replication of ACLs after rsync somehow.

Ugly hack that seems to do the trick for us is to first rsync, then:

#!/usr/local/bin/perl -w

for my $oldfile (@ARGV) {
        my $newfile = $oldfile;
        $newfile =~ s{/export}{/newdir/export};

        next if -l $oldfile;

        open(F,"-|","/bin/ls","-ladV","--",$oldfile);
        my @a = <F>;
        close(F);
        my $crap = shift @a; # filename line
        chomp(@a);
        for (@a) {
                $_ =~ s/ //g;
        }
        my $acl = join(",",@a);
        system("/bin/chmod","A=".$acl,$newfile);
}


/bin/find /export -acl -print0 | xargs -0 /blah/aclcopy.pl


/Tomas
-- 
Tomas Forsman, st...@acc.umu.se, http://www.acc.umu.se/~stric/
|- Student at Computing Science, University of UmeƄ
`- Sysadmin at {cs,acc}.umu.se
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to