Linux backup server LD_PRELOAD

Wesley W. Terpstra terpstra at
Mon Oct 22 12:02:42 GMT 2007

I'm not sure if anyone else is interested, but here's a tool I've  
been using with rsync-3.0pre2 to backup my powerpc/mac onto linux  
with ext3 and fake-super:
         gcc -Wall -O2 -shared -fPIC -o libxattr.c -lsqlite3
This intercepts calls from rsync that deal with extended attributes.  
If the target is a symlink (where linux doesn't allow xattrs on  
symlinks) or the xattr is (ext3 has a  
limit of 4k attributes), the extended attribute is redirected into an  
sqlite3 database. Otherwise, the extended attribute is set using the  
native filesystem calls. There is a performance penalty to this  
library as it causes a stat() on each extended attribute system call.  
When sqlite3 writes many attributes there is also substantial slow-down.

Start rsync like this:
XATTR_LOG=/tmp/xattr.log XATTR_DB=/var/whatever/xattr.db  
LD_PRELOAD=.../ rsync <options>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libxattr.c
Type: application/octet-stream
Size: 15744 bytes
Desc: not available
Url :

More information about the rsync mailing list