curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Quoting to delete remote file does not work when pulling a file

From: Stolz, Werner \(Chicago\) via curl-users <curl-users_at_cool.haxx.se>
Date: Thu, 28 May 2020 14:21:56 +0000

Well, I must admit that I am embarrassed. I thought that I had carefully read the man page, but upon re-reading it, I see that
this is prominently documented.

Thank you very much for your help.

Werner Stolz
Senior Software Developer
Tegra118
Office: + 1 312-739-2256 | Mobile: + 1 331-238-3870
www.tegra118.com

Date: Wed, 27 May 2020 21:21:46 +0000
From: "Stolz, Werner (Chicago)" <Werner.Stolz_at_Fiserv.com>
To: "curl-users_at_cool.haxx.se" <curl-users_at_cool.haxx.se>
Subject: Quoting to delete remote file does not work when pulling a
        file
Message-ID:
        <SN6PR10MB2750CE116A006015C7E19BA7E1B10_at_SN6PR10MB2750.namprd10.prod.outlook.com>

Content-Type: text/plain; charset="utf-8"

I am using curl on an AIX server. Here is the version.
[DC:dev01:/interfaces/test/bin] curl --version curl 7.64.0 (powerpc-ibm-aix6.1.9.0) libcurl/7.64.0 OpenSSL/1.0.2o zlib/1.2.11 libssh2/1.8.2
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy

When I try to pull a file and then delete it from the remote server, curl delete the file BEFORE it pulls it. I searched for this type of error and could not find anyone else who has experienced it.

This is all in my development region, so I have control of both sides of the transfer. Also, I made sure the file existed on the "remote" server before I ran this command:

[DC:dev01:/] curl -v -s -S https://urldefense.proofpoint.com/v2/url?u=sftp-3A__dev04.company.com-3A22_-7E_remotefilename.asc&d=DwIGaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=bF-T9PmGXJKRUPLQJzBzalRK2kxio3OrgZUBiu5-_LU&m=4XXkxSTCVqQM8h8GXgTvhm_567EkYLx4R5f8VbWSOps&s=rO20BPvdPU8PlbrjdBkMZ3JX7faIxO7V5n4FzGxaLSw&e= -o /interfaces/xyz/ext/rec>
* Expire in 0 ms for 6 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 0 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 2 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 1 ms for 1 (transfer 0x11004eb30)
* Expire in 2 ms for 1 (transfer 0x11004eb30)
* Expire in 2 ms for 1 (transfer 0x11004eb30)
* Expire in 2 ms for 1 (transfer 0x11004eb30)
* Expire in 2 ms for 1 (transfer 0x11004eb30)
* Trying 10.31.160.117...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x11004eb30)
* Connected to dev04.company.com (10.31.160.117) port 22 (#0)
* SSH MD5 fingerprint: fc157cbdc919be051237cd41bdf2a2ea
* SSH host check: 0, key: AXXAB3NzaC1yc2EAAACAAQABAAABAQDGpW8Jq/FkjpXh1uGMHUEB7CFQXHdiBeVaewUYFxls974Skdispdhs/xZvq2PzJQ15gphvOmkxEH9xrBhLoLipb+4vOeXG1gSZSMKWtmTa99BcORxJxjf10mW8icMLgxUFGWELRzDDSCk4EAXfL1qNc+6jdvHzJVwc9LZz2yC9zmbyEtXyF66nXmNgdBTzMXEYRf+T4IAYo9HSaX6X7R6AEV7X5TxKSMTRCmLxb7aC4MJLat/bauNG8ozAZj1gicByabDBC2CgRl/Jq/4NUqY/eivduJxbj5U6q24VJE3I9+4yezcLPp5bus4sl9uC4JXqJ8kwGguFRbsVSjk1axY9
* SSH authentication methods available: publickey,password,keyboard-interactive,hostbased
* Using SSH private key file '/home/user/.ssh/id_rsa'
* Initialized SSH public key authentication
* Authentication complete
* Sending quote commands
* Could not open remote file for reading: No such file or directory
* Connection #0 to host dev04.company.com left intact
curl: (78) Could not open remote file for reading: No such file or directory

Werner Stolz
Senior Software Developer
Tegra118
Office: + 1 312-739-2256 | Mobile: + 1 331-238-3870 https://urldefense.proofpoint.com/v2/url?u=http-3A__www.tegra118.com&d=DwIGaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=bF-T9PmGXJKRUPLQJzBzalRK2kxio3OrgZUBiu5-_LU&m=4XXkxSTCVqQM8h8GXgTvhm_567EkYLx4R5f8VbWSOps&s=rPombKuEoMsTarwbFyDZQDfZo2AKu4w4ePFQqtBq_9A&e= <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.tegra118.com&d=DwIGaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=bF-T9PmGXJKRUPLQJzBzalRK2kxio3OrgZUBiu5-_LU&m=4XXkxSTCVqQM8h8GXgTvhm_567EkYLx4R5f8VbWSOps&s=rPombKuEoMsTarwbFyDZQDfZo2AKu4w4ePFQqtBq_9A&e= >

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=http-3A__cool.haxx.se_pipermail_curl-2Dusers_attachments_20200527_71c94998_attachment-2D0001.html&d=DwIGaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=bF-T9PmGXJKRUPLQJzBzalRK2kxio3OrgZUBiu5-_LU&m=4XXkxSTCVqQM8h8GXgTvhm_567EkYLx4R5f8VbWSOps&s=BkahJEnVAaiJkNPWgpM6FmDV2c9uvLjy-rbj2fq1GJ0&e= >

------------------------------

Message: 2
Date: Thu, 28 May 2020 07:50:17 +0200
From: Dan <dan_at_coneharvesters.com>
To: curl-users_at_cool.haxx.se
Subject: Re: Quoting to delete remote file does not work when pulling
        a file
Message-ID: <20200528055016.GA19701_at_boulder.fritz.box>
Content-Type: text/plain; charset=iso-8859-1

On Wed, May 27, 2020 at 09:21:46PM +0000, Stolz, Werner (Chicago) via curl-users wrote:
> When I try to pull a file and then delete it from the remote server,
> curl delete the file BEFORE it pulls it. I searched for this type of
> error and could not find anyone else who has experienced it.

The quote command didn't show up in your message, but I assume it was something like '-Q rm remotefilename.asc'. That behaviour would be working as documented.
To run the command after the transfer, it needs to be preceded with -, so something like '-Q -rm remotefilename.asc'.

Dan

------------------------------

Subject: Digest Footer

_______________________________________________
curl-users mailing list
curl-users_at_cool.haxx.se
https://urldefense.proofpoint.com/v2/url?u=https-3A__cool.haxx.se_cgi-2Dbin_mailman_listinfo_curl-2Dusers&d=DwIGaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=bF-T9PmGXJKRUPLQJzBzalRK2kxio3OrgZUBiu5-_LU&m=4XXkxSTCVqQM8h8GXgTvhm_567EkYLx4R5f8VbWSOps&s=yzHO6Dezf685Tuv8iY2TJShWpfwwkovG9646lW8T6lI&e=

------------------------------

End of curl-users Digest, Vol 177, Issue 23
*******************************************

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-05-28