Copying root owned directories...
Jerry LeVan
jerry.levan at eku.edu
Wed Aug 8 10:48:04 PDT 2007
Hi,
I am puzzling over how to elegantly copy a root protected directory
from one mac to another mac.
ie I have a wiki and want to propagate changes on one machine to
others as a sort of backup/convenience.
For example I can push changes to my linux box by the following
script ( transferToLinux.sh) invoked by something like (as root)
transferToLinux.sh MacInfo
#!/bin/sh
/usr/bin/rsync -avu /usr/local/share/moin/mywiki/data/pages/$1/
root at linuxbox:/var/mywiki/data/pages/$1
echo logging into linuxbox and executing "chown -R apache:apache /var/
mywiki/data/pages/$1"
ssh root at linuxbox "chown -R apache:apache /var/mywiki/data/pages/$1"
Unfortunately if linuxbox is a mac then ssh and rsync don't
authenticate since
there is no root login on the mac...
Are there any neat workarounds without having to enable the root
account on
the macs?
My current workaround is to push to a linux box and then pull from
the linux box
with a similar rsync script (transferFromLinux.sh).
#!/bin/sh
/usr/bin/rsync -avu root at linuxbox:/var/mywiki/data/pages/$1/ /usr/
local/share/moin/mywiki/data/pages/$1
chown -R www:www /usr/local/share/moin/mywiki/data/pages/$1
Seems like there ought to be a simpler way...
Thanks,
Jerry
More information about the MacOSX-admin
mailing list