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.
|
There is probably a more proper way, but here is one idea:
Code:
$ scp bigfile user@host:~ || ssh user@host rm bigfile |
All times are GMT -5. The time now is 09:41 AM. |