[CentOS] RE: Keeping data on 2 servers in sync !

Fri Dec 9 03:19:37 UTC 2005
Bryan J. Smith <thebs413 at earthlink.net>

> There are options for transferring ownership and perms
> (-owner and -perms), although I admit I haven't tried them.
> If they don't work right, but you know how things are
> supposed to look, you can always run chmod & chown
> afterward.

getfacl can dump an entire tree's permissions to a file --
both UNIX and Extended Attributes (EA) Access Control Lists
(ACLs).  You could then rsync that file, and run it on the
other side.  In
fact, that's how I deal with the fact I don't want another
system login in to SSH as root.  

Basically: 
   cd /wherever 
   syncstamp="`date +%Y%m%d%H%M%S`"
   getfacl -R . > .facl_${syncstamp}
   rsync -ave "ssh" . reguser at otherserver
   rm .facl_${syncstamp}

And then a root cronjob on another server basically looks for
.facl_* files periodically and runs:  
   cd /whereever
   set -o noglob
   for ifacl in .facl_*; do
     setfacl --restore=${ifacl}
     rm ${ifacl}
   done

In fact, since Red Hat insists on not supporting XFS with its
xfsdump that maintains EAs, and Ext3's dump does nothing of
the sort (and I'm not a huge fan of star), I use getfacl to
store the original ACLs with my backup in a file included
with the backup.



-- 
Bryan J. Smith                | Sent from Yahoo Mail
mailto:b.j.smith at ieee.org     |  (please excuse any
http://thebs413.blogspot.com/ |   missing headers)