Feature requests for scp and ssh

Darren Tucker dtucker at zip.com.au
Mon Jan 17 11:43:08 EST 2005


Simon Kissane wrote:
> Would it be possible to add an option to the scp command, so that if a
> destination file already exists, rather than overwriting it, scp just
> skips the destination file, prints a message to stderr and returns an
> error (non-zero) exit? That would help me immensely.

That would require another option to be passed to the remote scp process 
to enable that behaviour, which would be a potential interop problem. 
This means it's not likely to ever happen (see 
http://www.openssh.com/faq.html#2.10).

You can use sftp in batch mode to do it with something like:
$ echo "ls /tmp/foo" | sftp -b - localhost || \
	echo "put foo /tmp/foo" | sftp -b - localhost

This isn't going to save you from partial transfers, however.  You may 
be better off using rsync-over-ssh.

> Also, you might want to think about providing a way to execute a
> series of ssh, scp and sftp commands through one authentication
> session, so if using password authentication you don't need to keep on
> re-keying the password.

That already exists.  Check out the ControlPath and ControlMaster 
options in 3.9x.

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.




More information about the openssh-unix-dev mailing list