LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-08-2004, 10:37 AM   #1
Jonasx
Member
 
Registered: Sep 2003
Location: In the network closet
Distribution: Gentoo
Posts: 37

Rep: Reputation: 15
File copying questions


I'm preparing to migrate a mail server to a new machine. I running an IMAP server with maildirs and need to copy the contents of all the malldir forders to the new box with all the file attributes intact. I'm adding some new user mail diretories to the new machine. If I just copy the entire /home directory from the old box to the new, will this retain my attributes correctly?

My plan is this...

1. Set up a skel pattern for the new directory structure.

2. Batch add all old users to create the directory structures in /home that I want.

3. copy the /etc/passwd, /etc/shadow, /etc/group and /etc/sgroup over to the new machine from the old machine

4. Copy the entire /home directory from the old machine to the new.

5. Live happily ever after?

Where will I run into problems?

Thanks Much.
 
Old 01-08-2004, 11:25 AM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
Specifying the -a switch to the 'cp' command (i.e. cp -a /home/*) will retain all of the file attributes (UID, GID, permissions) and also copies recursively through subdirectories.

How were you planning on copying everything to the new machine? Samba? NFS? FTP?

Last edited by itsme86; 01-08-2004 at 11:27 AM.
 
Old 01-08-2004, 12:06 PM   #3
Jonasx
Member
 
Registered: Sep 2003
Location: In the network closet
Distribution: Gentoo
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
How were you planning on copying everything to the new machine? Samba? NFS? FTP?
was planning on using scp but I cant seem to figure out how to make it retain the permissions/ownerships...any ideas?

-p seems to only -- "Preserves modification times, access times, and modes from the original file."

Last edited by Jonasx; 01-08-2004 at 12:33 PM.
 
Old 01-08-2004, 01:19 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Try this approach :}

http://www.linuxquestions.org/questi...hreadid=106839


Cheers,
Tink
 
Old 01-08-2004, 01:27 PM   #5
Jonasx
Member
 
Registered: Sep 2003
Location: In the network closet
Distribution: Gentoo
Posts: 37

Original Poster
Rep: Reputation: 15
Excellent idea...archiving didnt even ross my mind...will try..

Thanks Much
 
Old 01-08-2004, 01:38 PM   #6
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Using rsync may be a bit quicker.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dvd Copying questions gianh Linux - Software 2 08-16-2004 11:17 AM
Question on File System and File Copying hey_joe Linux - Newbie 2 11-05-2003 11:30 AM
copying file ronss Linux - Software 3 08-31-2003 04:04 AM
Copying a File... Nefarious Linux - General 3 11-28-2002 01:23 AM
Copying a file tgonetwork Linux - Newbie 3 01-16-2002 11:08 AM


All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration