01-28-2008 09:47 PM
I need to copy the users from one server to another and create their home directories as well. Any specific instructions on how to do this? Can I just copy the /etc/passwd and /etc/group? How about the directories? Do I have to create them manually?
Thanks in advance!
Solved! Go to Solution.
01-28-2008 09:55 PM
Please have look on the following threads
Thanks & Regards
01-28-2008 10:03 PM
You will have to make directories manually or copy the direcories to new system.
01-28-2008 10:12 PM
Use -p to preserve permissions.
01-30-2008 01:15 AM
I tried to make a tar backup of my home directory. My current set up is that user directories are located on /home/user/user1....
#tar cvf /tmp/home.tar /home/user/
however, my tar archive contains only the contents of each users home directories. I cannot see the subdirectories of the /home/user. Also, how can I preserve the permission of each folder and its subdirectories?
01-30-2008 02:01 AM
when doing your backup
- I recommend NOT to use absolute pathnames.
- Create your tarfile at a place containing enough freespace (/tmp may be not big enough)
tar cvf /somewhere/backuser.tar user
You will see the progress of the backuped files on stdout.
01-30-2008 02:20 AM
I dont have enough space on my /home/user directory. Anyway, I have more than 100 users.. I tried making an archive using tar but it seems that only the contents of the users home directories are copied. It is not divided according to "each" users own home directory. Any suggestions on how to make it done the fastest way? Also, I need to preserve the permissions including those in the sub-directories. It would really take some time if I would archive each home directories one by one.
01-30-2008 03:28 AM
(This seems like an extra level of indirection.)
>#tar cvf /tmp/home.tar /home/user/
>my tar archive contains only the contents of each user's home directories. I cannot see the subdirectories of the /home/user.
You have dumped the subdirectories of the /home/user, what do you think is missing?
I suppose if each home directory is automounted, tar may not see them all?
Yes, this happens to me. You'll need:
#tar cvf /tmp/home.tar /home/user/*
Of course if this is automounted, then there is no need to move them because they aren't there on that machine.
>how can I preserve the permission of each folder and its subdirectories?
As Kapil said, you can use -p. But that is the default for root, when you extract.
>Peter: I recommend NOT to use absolute pathnames.
You can always use pax(1) to rename it.
> cd /home; tar cvf /somewhere/backuser.tar user
You can combine these into:
tar cvf /somewhere/backuser.tar -C /home user
>I don't have enough space on my /home/user directory.
That's why Peter said: /somewhere
>but it seems that only the contents of the users home directories are copied. It is not divided according to "each" users own home directory.
This is contradictory. /home/user contains ALL user's home directories. tar should get all of them if you start at /home/user.
Unless some are symlinks??
You need to give an example of a file that isn't backed up. And see if that shows up with "ll /home/user".
>Any suggestions on how to make it done the fastest way?
Mount them over NFS?
>I need to preserve the permissions including those in the sub-directories.
Automatic for root.
>It would really take some time if I would archive each home directories one by one.
You need to explain to us why the command you or what Peter gave isn't working.
01-30-2008 07:49 PM