scp removing the file after successful copy?

Damien Miller djm at mindrot.org
Wed Oct 30 13:16:07 EST 2002


Andrew Pollock wrote:
> G'day,
> 
> Sorry for the intrusion, just wondering if there are any plans to add a -u
> type option to scp like the commercial SSH's scp has, which removes
> the file after a successful copy? (particularly when copying a remote file 
> to local)
[snip]
> I did a quick search of this lists' archives, and I can see some comments
> relating to this sort of functionality in the past, including some
> patches, but it never seems to have made it into the mainstream release.

scp is officially in maintenance mode, i.e. no new features. It is based 
on a 20+ year old protocol and codebase which we don't want to extend 
further.

wrt your request, it may be possible to script this using scp exit 
status (though I saw some emails that this may be unreliable).

sftp's exit status should be reliable for this sort of thing (if not 
file a bug), so "sftp blah remote: && rm -f blah" should work.

-d







More information about the openssh-unix-dev mailing list