Surely a lapsus, it should be (replace user with your own login name): 

for i in * ; do chown -R user:user $i ; done

Anyway, maybe you can make a one-file from them before (tar, cpio, ...)
so after you scp it and decompress it on the new server you will
probably have the "right" owner (it's quite probably as sugested that
the UID and GID will not correspond to the one on the new server and
you'll have to change them or type the line before).

Maybe someone knows how to do it directly with scp options. Good luck.



El vie, 08-11-2002 a las 05:18, PlugHead escribió:
> If I'm reading the man page correctly, the -p option preserves the modes of 
> the files (e.g. rwx), not the owner.  Keeping the owners could be a bit 
> problematic, since the owner id on one system is probably different from the 
> owner id on another system...
> 
> If all of the your files need to have the same owner, I would first copy them 
> to some empty temp directory, do a 'chown user.group -R *' in that directory, 
> then move them to where they need to be...  Otherwise, I have no simple 
> answers... :)  
> 
> (Although, it should be possible to create a script that changes the owner, 
> based on the directory name under home (e.g. /home/plughead.)  Something 
> like:
> 
>   cd /home
>   for i in * ; do chown $i.$i -R $i ; done
> 
> might do the trick...)
> 
> HTH,
> -Jason
> 
> On Thursday 07 November 2002 10:13 pm, Sebastian McDonagh wrote:
> > Hi guys,
> >
> > Time to change over the mail server and am copying down /home to the new
> > server.  I am currently trying to do this via scp, now i dont claim to
> > be any expert but from reading the man pages on scp i should be able to
> > use the -rp switches to 1. Copy recursively and 2. maintain file
> > permissions of those directories and subdir.
> >
> > Anyway my problem is twofold and i would really appreciate any
> > assistance you guys could give.
> >
> > The first thing is copying the directories over,
> > The command i am using is,
> >
> > scp -rp X.X.X.X /home/* /home/
> >
> > Now this sure gets the directory down but then they are all owned by
> > root and are in the root group.  Now this is obviously going to be a
> > problem.
> >
> > What am i doing wrong ? Does anyone out there know how to maintain the
> > permissions of the files.
> >
> > The second issue is if i have the files down and they are all owned by
> > root and in the root group, does anyone have a script that would allow
> > me to change the ownership and groups of the 120 or so directorys.
> >
> > The ideal i spose would be to copy the necessary home directorys without
> > changing the permissions in the first place.
> >
> > Sorry if it is a bit rambling, would be great if someone was able to
> > assist.
> >
> > Regards
> >
> > Sebastian
> > ATR Australia
> 
> -- 
> 
> =========================
> "You like it?" he said to Mort, in pretty much the same tone of voice
> people used when they said to St George, "You killed a *what*?"
>         -- Mort tastes scrumble for the first time
>            (Terry Pratchett, Mort)
> 
> 
> ----
> 

> Want to buy your Pack or Services from MandrakeSoft? 
> Go to http://www.mandrakestore.com
-- 
           Diego  Dominguez                 
              __/\__  
             |      | 
 Andalucia  /        \  Spain
            \        /
             |__  __| 
                \/    


_______________________________________________________________
Yahoo! Messenger
Nueva versión: Webcam, voz, y mucho más ¡Gratis!
Descárgalo ya desde http://messenger.yahoo.es

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to