Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-03-2008, 01:58 PM   #1
LQ Newbie
Registered: Jan 2003
Posts: 8

Rep: Reputation: 0
I abort scp, how do I clean up?

I am programaticly scp'ing a large file between two servers. For a variety of reaons (such as low disk space) this process can be aborted. When the scp client is killed the destination retains a partially transferred file. Since the file is incomplete I would like it to be automatically deleted. Is there a simple way to do this? I didn't seen any intuitive options on the scp man page.
Old 01-03-2008, 03:25 PM   #2
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
There is probably a more proper way, but here is one idea:
$ scp bigfile user@host:~ || ssh user@host rm bigfile
(bash shell obviously.)



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-28-2008 11:41 PM
SCSI ABORT operation problem halturata Linux - Hardware 1 09-04-2007 02:46 AM
apt-get >> abort problem Coldfish Debian 1 09-23-2005 09:42 AM
Adaptec aic7xxx ABORT -- need help!!! geos Linux - Hardware 1 07-15-2003 08:26 PM
passwd: Critical error - immediate abort dojit Linux - General 2 03-07-2001 01:04 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration