Final conversion questions

Bob Martin bob at buckhorn.net
Sat Feb 28 11:53:02 PST 2004


Scott,
I haven't followed this thread closely enough, but from what you're 
saying, it sounds like you have a NFS connection between the 2 boxen. 
That being the case, and since the UID/GID's are the same on both boxen 
(IIRC you moved the Linux accounts to the BSD box), the following 
command will get all of the files, and maintain the permissions:

cp -pRP /<linux mount point/home/* /home/

If the UID/GID's have changed, then this command will fix them for you:
(Note, this assumes you use bash as your shell)
cd /home
for a in `ls -1 /home`;do chown -R $a:users $a;done

That command does assume that you have a 1 to 1 relationship between 
home directories and usernames. If not, let me know and I'll find my 
little perl script that reads /etc/passwd and sets the permissions.

Bob Martin

Scott St. John wrote:
> Thanks to help from this list I am proud to say that tonight I will be 
> moving our mail server from Linux/Sendmail to FreeBSD/Postfix!  The user 
> passwd file has been converted and we are ready to rock, but I have a few 
> questions before I begin tonight.
> 
> I plan to copy the users home directories over, does anyone have a script 
> that will go through the home directories and correctly set the ownership of 
> the directories once they are copied over?  Example, user Fred has a home 
> dir on the old machine, I copy over the files to the BSD box, I need to 
> chown -R fred:users to his home directory.  I could do it by hand, but I am 
> sure there has to be a script out there to do something similar?
> 
> Second question, I want to make sure ALL files are copied over from the home 
> directories and I think I have the syntax wrong to get the files, I want 
> the .procmailrc files to transfer over.
> 
> Thanks in advance!
> 
> -Scott
> 
> _______________________________________________
> freebsd-isp at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-isp
> To unsubscribe, send any mail to "freebsd-isp-unsubscribe at freebsd.org"



More information about the freebsd-isp mailing list