Syntax error /w curl?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Syntax error /w curl?
# 1  
Old 11-12-2010
Syntax error /w curl?

Hello all-

I'm (hopefully) trying to replace a WS_FTP (Windows program) job with a curl command in a script on UNIX.

In short, this process has been in place for some time, and in curl I am getting directory perm issues, which does not seem to be accurate, since this process has been in place in WS_FTP for quite some time. I am suspicious I have a syntax error of some kind.

Any ideas? I need to use ssl, and I login as a particular user, and I have to place the file into a different directory than what is set as the default when the user logs in. Here is what I have:
Code:
curl --ftp-ssl -u name:pass -k -T /tmp/file.txt ftp://000.000.000.000:20021/remotefolder/file.txt


Result:
Code:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (9) Server denied you to change to the given directory

Thank you so much for any tips provided.
Code:
curl version info:
curl 7.15.3 (hppa2.0w-hp-hpux11.11) libcurl/7.15.3 OpenSSL/0.9.7i zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: IPv6 Largefile NTLM SSL libz

---------- Post updated at 10:52 AM ---------- Previous update was at 10:24 AM ----------

Hmm. I may be out of luck using curl. I received the following note from the admin of the target server:

"...you need to plece the user id, password, change directory and put or get command each on completely separate lines. We do not work on a true tree structure."

So...is there a way to do this with curl?

Thanks all.




Last edited by Scott; 11-12-2010 at 02:31 PM.. Reason: More code tags
# 2  
Old 11-12-2010
Quote:
"...you need to plece the user id, password, change directory and put or get command each on completely separate lines. We do not work on a true tree structure."
???

Try this:

Code:
curl --ftp-ssl -u name:pass -k -Q "CWD remotefolder" -T /tmp/file.txt ftp://000.000.000.000:20021/file.txt

This User Gave Thanks to verdepollo For This Post:
# 3  
Old 11-12-2010
verdepollo you are IMPRESSIVE.

Your suggestion has worked out PERFECTLY, and you are a person truly deserving of a large cold frothy BEER.

I really appreciate your excellent help. This has been a headache for me and now I can go home Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Curl Command Error

Good afternnon. I need your help please to understand the basics of curl command to test web services. Ive heard i can test a web service using this command,so: curl http://glb_osb_fs.nh.inet:7110/serverglobal/services/StrategicPlanning/NotifyMNPAction_v1 it yields some errors, i would... (5 Replies)
Discussion started by: alexcol
5 Replies

2. Shell Programming and Scripting

Curl/http 503 error with bash script

I am trying to use REST API and curl in a bash script to generate a http report. The curl command at the end of the script should generate a html file but instead I get an error "HTTP/1.1 503 Service Unavailable". This is the script #!/bin/bash export... (7 Replies)
Discussion started by: kieranfoley
7 Replies

3. Shell Programming and Scripting

CURL syntax

Topic : cmd to check status of url using Curl I have below 2 lines which r working fine /usr/bin/curl -u user:pasword http://hostname /usr/bin/curl -connect-timeout=10 http://hostname Now I want to use user:pasword and connect-timeout parameter in one line /usr/bin/curl -u user:pasword... (1 Reply)
Discussion started by: sam@sam
1 Replies

4. Web Development

Error on executing soap request using Curl command

hi, i have curl command to POST a soap request to web service. I have a file (query.xml) which has all the soap message attached to it I just don't seem to be able to properly post it. curl command curl -s -H "Content-Type: text/soap+xml;charset=UTF-8" -H "SOAPAction:" -d @query.xml... (2 Replies)
Discussion started by: siramitsharma
2 Replies

5. SCO

Curl error

Hello I want to use the Curl and gives me this error. Can someone help me out # curl http : // www .google . es dynamic linker: curl: binder error: symbol not... (3 Replies)
Discussion started by: fersys
3 Replies

6. Red Hat

Error while starting Apache after compiling PHP and Curl

Hello, I am facing an issue while starting the apache server after compiling php and curl. Below are the versions i am using. php-5.2.17 httpd-2.2.17 curl-7.16.0 CentOS5.5x64 Compiling above packages without curl working very fine but when trying to compile php with curl below error is... (1 Reply)
Discussion started by: sunnysthakur
1 Replies

7. Shell Programming and Scripting

CURL getting Error- couldn't connect to host

Hi i am trying to open HTTP by curl command. i am tryng to do that from command or script BASH. also iptables is off it doesnt work i am getting an error: curl: (7) coudn't connect to host the scipt is: #! /bin/bash curl http://www.cnn.com (1 Reply)
Discussion started by: zigizag
1 Replies

8. UNIX for Advanced & Expert Users

Syntax issue in curl for getting a file from http site

Hi All I am using curl in my client environment. We need to pull a file from the libraries site. All the files are having perticular URL which can be used to get the files. Only issue is, when we fire that command , it will take to authentication page 1st. once authentication is succed, it will... (1 Reply)
Discussion started by: prabirkumardhar
1 Replies

9. Shell Programming and Scripting

curl certificate error

Hi, I am getting below error when I do ------------------------------- curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed More details here: cURL - Details on Server SSL Certificates... (5 Replies)
Discussion started by: Anjan1
5 Replies

10. Shell Programming and Scripting

curl error trapping in ksh

I hope that I can trap curl errors, and have my shell script error out and quit if curl has any sort of problem. For example, I have the following command in my shell script: curl --trace -n -v --ftp-ssl ftp://xxx.xxx.xxx.xxx:2122 --user user:password -o /tmp/file.txt Works great, except... (2 Replies)
Discussion started by: prestonatwork
2 Replies
Login or Register to Ask a Question