cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Remove remote file issue using CURL SFTP

From: Young,Jim <Jim.Young_at_cerner.com>
Date: Fri, 9 Jul 2010 17:00:21 -0500

>As you can see above, I am getting 'Permission denied' issue while deleting the file (after download) on TEST B. In order to debug the issue, I executed the following >scenarios on TEST B:

 1. curl -v -u adc_xfer: -O --key /apps2/edi/.ssh/id_rsa --pubkey /apps2/edi/.ssh/id_rsa.pub sftp://secureftp.ppp.com:10022/testt.txt -Q 'rm testt.txt' (This doesn't contain '-' sign before 'rm'): In this case, as expected, file was deleted successfully and the file download failed (because file was already deleted)
 2. curl -v -u adc_xfer: --key /apps2/edi/.ssh/id_rsa --pubkey /apps2/edi/.ssh/id_rsa.pub sftp://secureftp.ppp.com:10022/ -Q '-rm testt.txt' (This doesn't contain '-O' option and the file name in the SFTP url): In this case, as expected, file was deleted successfully.
 3. Manual SFTP (without CURL): When I manually login to the remote using SFTP and download and then delete the remote file, it works without any issue.

The successful execution of the above scenarios really amazed me as to why the 'file deletion after download' doesn't work with CURL SFTP. FYI, the file size is really small.
Could it be that file download and file deletion is happening at the same instant of time? If so, is there any way to correct that?

I've noticed the same problem and haven't found a solution to it either. I just coded around it in my shell script.

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-07-10