This should help. It's what we used for our refresh. You'll need to adjust the group name to match your environment.
I used tar because I knew it could be trusted to replicate things exactly. I had tried cp, and found that some data wasn't quite right (I forget what it missed, but I suspect it was metadata). This was before I knew about ditto, pax, or cpio.
#!/bin/sh
src=${1}
dst=${2}
if [ -z "${src}" -o -z "${dst}" ]
then
echo "Usage: sudo ${0} SOURCE DEST"
exit 2
fi
s_base=$(basename "${src}")
d_base=$(basename "${dst}")
s_dir=$(dirname "${src}")
d_dir=$(dirname "${dst}")
if [ "$(whoami)" != "root" ]
then
echo "Error: You must be root. Try using sudo."
exit 1
fi
if [ ! -d "${dst}" ]
then
echo "Error: ${d_base} must log in at least once first."
exit 3
fi
/bin/mv -i "${dst}" "${dst}.old"
/bin/mkdir "${dst}"
/usr/bin/tar -C "${s_dir}" -c "${s_base}" |
/usr/bin/tar -C "${dst}" -xpv --strip-components 1
echo "Fixing permissions"
/usr/sbin/chown -R "${d_base}" "${dst}"
/usr/bin/chgrp -R "Domain Users" "${dst}"
If you look in the Deploy Studio script kit, there are plenty of user data migration scripts. They could easily be migrated to Casper.
Thanks.
So my methodology wasn't wrong.
I might still try & GUI it with the option to "login" as the user from within the all the select source & dest. Should be pretty easy.
The only problem I've had is reading what users & groups have what permissions. Man page anyone?
Regards,
Ben.
If the Mac you're running on is bound to AD, chown will be able to set the ownership correctly. I could probably put more logic in to autodetect the right group, but I have insufficient motivation to do so, for now.
I do want to mention that you should never use non-HFS+ filesystems to store any significant Mac data, without archiving it first. Loss of metadata can be extremely frustrating, and can bite you even years later, when the original data is long gone.