copy home folder

Brian McKee brian.mckee at gmail.com
Tue Jul 14 23:46:31 UTC 2009


On Tue, Jul 14, 2009 at 6:59 AM, Asad<asad2k6 at hotmail.com> wrote:
>
> what ssh command to copy an entire home folder? What if a user is already
> logged in would its home folder copy fail ?

Lots of ways to do that.  ssh doensn't require anything 'special' -
it's just like you were using the terminal locally.  Unless you mean
'use ssh to copy home folder to another computer'.  In that case you
have two obvious choices (and lots of less obvious ones)

1 - scp - e.g. scp -r user at remote_computer:~/ .
That uses scp to recursively copy (the -r) the user's home folder (~)
to here (.)

2 - rsync - e.g. rsync -avz user at remote_computer:~/ .
Like scp above, but has the advantage that if you re-run it, or it
gets interupted, it can pick up from where it left off.

If the user is logged in it will still work.  Note however that if the
user is changing files (i.e. doing almost anything) you can't
guarantee that you will get the newest version, or a coherent set of
files, as you don't know if it was copied before or after they changed
it.

HTH
Brian


-- 
All you need to know about Ubuntu 9.04 Jaunty -> gconftool -s --type
bool /apps/update-notifier/auto_launch false




More information about the ubuntu-users mailing list