From owner-freebsd-questions Wed Feb 13 3:39:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from deathrow.mail.pas.earthlink.net (deathrow.mail.pas.earthlink.net [207.217.120.19]) by hub.freebsd.org (Postfix) with ESMTP id 4B04A37B405 for ; Wed, 13 Feb 2002 03:39:15 -0800 (PST) Received: from falcon.mail.pas.earthlink.net ([207.217.120.74] helo=falcon.prod.itd.earthlink.net) by deathrow.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16ajFw-0004px-00 for freebsd-questions@freebsd.org; Tue, 12 Feb 2002 12:10:24 -0800 Received: from sdn-ar-003dcwashp050.dialsprint.net ([206.133.21.34] helo=moo.holy.cow) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16ajFt-0005Zc-00; Tue, 12 Feb 2002 12:10:21 -0800 Received: by moo.holy.cow (Postfix, from userid 1001) id 7AA2F50B8B; Tue, 12 Feb 2002 15:12:20 -0500 (EST) Date: Tue, 12 Feb 2002 15:12:20 -0500 From: parv To: Peter Brezny Cc: freebsd-questions@freebsd.org Subject: Re: scp odd behavior Message-ID: <20020212201220.GD23041@moo.holy.cow> Mail-Followup-To: Peter Brezny , freebsd-questions@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG in message , wrote Peter Brezny thusly... > > > These two seemingly identical statements are giving different results. > > the first scp command copies the data in the htdocs filder and puts it in > the data directory > the second scp command creates an htdocs director in the data directory. > > scp -i /bkup/.ssh/identity -r -q user@host1.com:/usr/local/htdocs/ > /home/www/data/ > scp -i /bkup/.ssh/identity -r -q user@host2.com:/usr/local/htdocs/ > /home/www/data/ > > What have i missed? do you correctly remember specifying the last "/" after "htdocs"? i have not yet come across the problem as i always specify the last "/" if i need only the contents of a directory copied. it may or may not help further... rsync copies directory _and_ its contents if the last slash is missing from the source path (on the target). otherwise it copies only the contents. compare... rsync /tmp/ $HOME/tmp rsync /tmp $HOME/tmp - parv -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message