curl-users
Upload via FTPS not uploading
Date: Wed, 14 Aug 2013 17:49:48 -0500
Hi,
I've been struggling with a one liner to upload files with curl via FTPS.
I've done extensive googling, but I'm not really getting many error
messages (that I think are relevant), so I'm having a really hard time
finding anything that's helping.
The errors make it look like it's failing because it can't get the file
size of the destination file. But that doesn't make much sense as the
destination file doesn't exist yet. I have triple checked and my user
account does have write permissions to the remote directory.
Any help or pointers are greatly appreciated!
My command is:
curl -k -v 1 --ftp-ssl --ftp-pasv --ftp-ssl-reqd -T /my.file
ftp://myusername@myhost:port/backup_dir/my.file
When I do this, I see the following output:
* About to connect() to 1 port 80 (#0)
* Trying 0.0.0.1... Failed to connect to 0.0.0.1: Invalid argument
* Success
* couldn't connect to host
* Closing connection #0
curl: (7) Failed to connect to 0.0.0.1: Invalid argument
* About to connect() to $MYHOST port $PORT (#0)
* Trying $IP... connected
* Connected to $MYHOST ($MYHOSTIP) port $PORT (#0)
< 220 Service ready for new user. Note: username must take the form
domain:username
> AUTH SSL
< 234 Command AUTH okay; starting SSL connection.
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* subject: CN=$MYHOST,OU=PositiveSSL Wildcard,OU=Domain Control
Validated
* start date: Jan 07 00:00:00 2013 GMT
* expire date: Jan 25 23:59:59 2014 GMT
* common name: $MYHOST
* issuer: CN=PositiveSSL CA 2,O=COMODO CA
Limited,L=Salford,ST=Greater Manchester,C=GB
> USER $MYUSERNAME
< 331 User name okay, need password for $MYUSERNAME.
> PASS $PASSWORD
< 230 User logged in, proceed.
> PBSZ 0
< 200 Command PBSZ okay.
> PROT P
< 200 Command PROT okay.
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> CWD $REMOTEDIR
< 250 Directory changed to /$REMOTEDIR
> EPSV
* Connect data stream passively
< 229 Entering Passive Mode (|||20047|)
* Trying $IP... connected
* Connecting to $IP ($IP) port 20047
> TYPE I
< 200 Command TYPE okay.
> SIZE $DEST.FILE
< 550 /$REMOTEDIR/$REMOTEFILE: No such file or directory.
> RETR 1.test
< 550 /$REMOTEDIR/$REMOTEFILE: No such file or directory.
* RETR response: 550
* Remembering we are in dir "$REMOTEDIR/"
* Connection #0 to host $MYHOST left intact
curl: (78) RETR response: 550
> QUIT
< 221 Goodbye.
* Closing connection #0
ASCII dump:
== Info: About to connect() to 1 port 80 (#0)
== Info: Trying 0.0.0.1... == Info: Failed to connect to 0.0.0.1: Invalid
argument
== Info: Success
== Info: couldn't connect to host
== Info: Closing connection #0
== Info: About to connect() to $MYHOST port $PORT (#0)
== Info: Trying $MYHOSTIP... == Info: connected
== Info: Connected to $MYHOST ($MYHOSTIP) port $PORT (#0)
<= Recv header, 83 bytes (0x53)
0000: 220 Service ready for new user. Note: username must take the for
0040: m domain:username
=> Send header, 10 bytes (0xa)
0000: AUTH SSL
<= Recv header, 49 bytes (0x31)
0000: 234 Command AUTH okay; starting SSL connection.
== Info: Initializing NSS with certpath: sql:/etc/pki/nssdb
== Info: warning: ignoring value of ssl.verifyhost
== Info: skipping SSL peer certificate verification
== Info: SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
== Info: Server certificate:
== Info: subject: CN=$MYHOST,OU=PositiveSSL Wildcard,OU=Domain
Control Validated
== Info: start date: Jan 07 00:00:00 2013 GMT
== Info: expire date: Jan 25 23:59:59 2014 GMT
== Info: common name: $MYHOST
== Info: issuer: CN=PositiveSSL CA 2,O=COMODO CA
Limited,L=Salford,ST=Greater Manchester,C=GB
=> Send header, 38 bytes (0x26)
0000: USER $MYUSERNAME
<= Recv header, 72 bytes (0x48)
0000: 331 User name okay, need password for $MYUSERNAME
=> Send header, 19 bytes (0x13)
0000: PASS $PASSWORD
<= Recv header, 30 bytes (0x1e)
0000: 230 User logged in, proceed.
=> Send header, 8 bytes (0x8)
0000: PBSZ 0
<= Recv header, 24 bytes (0x18)
0000: 200 Command PBSZ okay.
=> Send header, 8 bytes (0x8)
0000: PROT P
<= Recv header, 24 bytes (0x18)
0000: 200 Command PROT okay.
=> Send header, 5 bytes (0x5)
0000: PWD
<= Recv header, 31 bytes (0x1f)
0000: 257 "/" is current directory.
== Info: Entry path is '/'
=> Send header, 25 bytes (0x19)
0000: CWD $REMOTEDIR
<= Recv header, 47 bytes (0x2f)
0000: 250 Directory changed to /$REMOTEDIR
=> Send header, 6 bytes (0x6)
0000: EPSV
== Info: Connect data stream passively
<= Recv header, 39 bytes (0x27)
0000: 229 Entering Passive Mode (|||20098|)
== Info: Trying 23.21.156.243... == Info: connected
== Info: Connecting to $REMOTEIP ($REMOTEIP) port 20098
=> Send header, 8 bytes (0x8)
0000: TYPE I
<= Recv header, 24 bytes (0x18)
0000: 200 Command TYPE okay.
=> Send header, 13 bytes (0xd)
0000: SIZE 1.test
<= Recv header, 61 bytes (0x3d)
0000: 550 /$REMOTEDIR/$REMOTEFILE: No such file or directory.
=> Send header, 13 bytes (0xd)
0000: RETR $REMOTEFILE
<= Recv header, 61 bytes (0x3d)
0000: 550 /$REMOTEDIR/$REMOTEFILE: No such file or directory.
== Info: RETR response: 550
== Info: Remembering we are in dir "$REMOTEDIR/"
== Info: Connection #0 to host $REMOTEHOST left intact
=> Send header, 6 bytes (0x6)
0000: QUIT
<= Recv header, 14 bytes (0xe)
0000: 221 Goodbye.
Thanks!
-------------------------------------------------------------------
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 2013-08-15