FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 08-12-2008, 10:54 PM
"Zach Uram"
 
Default transferring directories with scp/rsync?

Hello,

I have a directory /tmp/foo on my local host alpha.org and I wish to
transfer it to user Bob (/home/bob) in dirctory $HOME/www/bar on
remote host beta.org. How precisely can I do this 1) using scp 2)
using rsync? I would like to see the commands for doing this with both
methods. Ssh is running on both hosts.

Also what happens if the directory already existed on the remote host
and has some of the same file names. Is it possible to use md5sums so
that if a file is exact (same hash) it will prompt me and ask if I
want to over-write it before it does?

Zach


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 08-13-2008, 04:33 AM
Shachar Or
 
Default transferring directories with scp/rsync?

On Wednesday 13 August 2008 01:54, Zach Uram wrote:
> Hello,
>
> I have a directory /tmp/foo on my local host alpha.org and I wish to
> transfer it to user Bob (/home/bob) in dirctory $HOME/www/bar on
> remote host beta.org. How precisely can I do this 1) using scp 2)
> using rsync? I would like to see the commands for doing this with both
> methods. Ssh is running on both hosts.

please read the scp and rsync documentation,
>
> Also what happens if the directory already existed on the remote host
> and has some of the same file names. Is it possible to use md5sums so
> that if a file is exact (same hash) it will prompt me and ask if I
> want to over-write it before it does?

and experiment!
>
> Zach

--
Shachar Or | שחר אור
http://ox.freeallweb.org/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 08-13-2008, 12:49 PM
 
Default transferring directories with scp/rsync?

On Tue, Aug 12, 2008 at 06:54:30PM -0400, Zach Uram wrote:
> Hello,
>
> I have a directory /tmp/foo on my local host alpha.org and I wish to
> transfer it to user Bob (/home/bob) in dirctory $HOME/www/bar on
> remote host beta.org. How precisely can I do this 1) using scp 2)
> using rsync? I would like to see the commands for doing this with both
> methods. Ssh is running on both hosts.
>
> Also what happens if the directory already existed on the remote host
> and has some of the same file names. Is it possible to use md5sums so
> that if a file is exact (same hash) it will prompt me and ask if I
> want to over-write it before it does?
>
> Zach
>

If you prefer scp you can make a tar archive of contents first:
tar -cvvf package.tar.gz /tmp/foo
and transfer it to beta.org:
scp package.tar.gz bob@beta.org:/home/bob/www/bar
In beta.org:
cd /home/bob/www/bar ; tar xvzf package.tar.gz ; rm package.tar.gz

Issuing this command on alpha.org will synchronize content of /tmp/foo
to /home/bob/www/bar in beta.org:
rsync -a /tmp/foo bob@beta.org:/home/bob/www/bar

Scp will overwrite your files if beta.org has same filesnames in that
directory.

- Henri Salo


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 08-14-2008, 07:11 AM
Tzafrir Cohen
 
Default transferring directories with scp/rsync?

On Tue, Aug 12, 2008 at 06:54:30PM -0400, Zach Uram wrote:
> Hello,
>
> I have a directory /tmp/foo on my local host alpha.org and I wish to
> transfer it to user Bob (/home/bob) in dirctory $HOME/www/bar on
> remote host beta.org. How precisely can I do this 1) using scp 2)
> using rsync? I would like to see the commands for doing this with both
> methods. Ssh is running on both hosts.

'rsync -a' or 'scp -pr' . Trailing slashes may be very meaningful with
rsync. e.g. the following two have different results:

rsync dirname bob@beta.org:ww/bar
rsync dirname/ bob@beta.org:ww/bar

>
> Also what happens if the directory already existed on the remote host
> and has some of the same file names. Is it possible to use md5sums so
> that if a file is exact (same hash) it will prompt me and ask if I
> want to over-write it before it does?

If you want that, use rsync .

rsync is generally nicer than scp.

--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
ICQ# 16849754 | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 08-25-2008, 03:39 PM
Osamu Aoki
 
Default transferring directories with scp/rsync?

On Tue, Aug 12, 2008 at 06:54:30PM -0400, Zach Uram wrote:
> Hello,
>
> I have a directory /tmp/foo on my local host alpha.org and I wish to
> transfer it to user Bob (/home/bob) in dirctory $HOME/www/bar on
> remote host beta.org. How precisely can I do this 1) using scp 2)
> using rsync? I would like to see the commands for doing this with both
> methods. Ssh is running on both hosts.

Yes to both!

> Also what happens if the directory already existed on the remote host
> and has some of the same file names. Is it possible to use md5sums so
> that if a file is exact (same hash) it will prompt me and ask if I
> want to over-write it before it does?

That depends on option used.

Anyway, read these pages:

http://people.debian.org/~osamu/pub/getwiki/html/ch11.en.html#sharingcopyingandarchiving
http://people.debian.org/~osamu/pub/getwiki/html/ch11.en.html#idiomsforthecopy

Osamu




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 08-25-2008, 03:39 PM
Osamu Aoki
 
Default transferring directories with scp/rsync?

On Tue, Aug 12, 2008 at 06:54:30PM -0400, Zach Uram wrote:
> Hello,
>
> I have a directory /tmp/foo on my local host alpha.org and I wish to
> transfer it to user Bob (/home/bob) in dirctory $HOME/www/bar on
> remote host beta.org. How precisely can I do this 1) using scp 2)
> using rsync? I would like to see the commands for doing this with both
> methods. Ssh is running on both hosts.

Yes to both!

> Also what happens if the directory already existed on the remote host
> and has some of the same file names. Is it possible to use md5sums so
> that if a file is exact (same hash) it will prompt me and ask if I
> want to over-write it before it does?

That depends on option used.

Anyway, read these pages:

http://people.debian.org/~osamu/pub/getwiki/html/ch11.en.html#sharingcopyingandarchiving
http://people.debian.org/~osamu/pub/getwiki/html/ch11.en.html#idiomsforthecopy

Osamu




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 08:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org