LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-29-2013, 07:46 AM   #1
redhatuser1
Member
 
Registered: Sep 2009
Posts: 55

Rep: Reputation: 0
Curl help - desperately required


Hi,

I had this working about a month ago, I cannot think of any new environment change etc that would effect but can someone help me get to the bottom of it please - I have about 5 hours to fix it

Usually I have a script which builds the command (it uploads anything between 0-250 files nightly) unfortunately when I execute the script I receive the following output:

Code:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0  7095    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

I receive that for every single file - it contains the total but it doesn't actually complete the transfer - no errors are reported and there are no active firewalls as the servers are working on the same network. Any thoughts?

It is a production server so a reboot is not really possible.

I don't know a whole lot about CURL but have spent a long time googling and it hasn't turned up anything yet. Any help would be greatly appreciated!

The Curl command is as follows:
Code:
 curl -u $SPUSER:$SPPASS -T $lines $URL >> $LOGFILE
$SPUSER = the username
$SPPASS = the password
$lines = the filename of the filename being transferred
$URL= the http addres
$LOGFILE = the log

If I run the command manually it doesn't seem to do anything, just imediately returns the prompt - if I append > logfile.txt I receive the above output.
 
Old 11-29-2013, 08:09 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825
So to confirm, apart from setting the variables and the interpreter line at the top of the script, the curl line is the only other entry?

Is this a bash script? If yes, you can try placing the following as the second line and remove the redirection:
Code:
set -xv
 
Old 11-29-2013, 08:13 AM   #3
redhatuser1
Member
 
Registered: Sep 2009
Posts: 55

Original Poster
Rep: Reputation: 0
Hi,

No, the script itself is much longer as it completes a range of other tasks. Regardless I am also manually trying to run the curl command via putty and it produces the same (empty) output.

The command line is:

Code:
curl -u domain//sharepointuser:sharepointpass -T filename.txt http://sharepointserver:sharepointport/Sub-site/Library/filename.txt
That produces nothing, simply presents the prompt instantly. If I add > output.txt I receive the empty progress bar etc.

I tried curl http://www.google.co.uk and that works, however curl http://sharepointserver:sharepointport doesn't - again it just doesn't seem to do anything. I am not aware of any services which curl may require and SharePoint is pretty much a clean installation.

---------- Post added 11-29-13 at 08:14 AM ----------

Thanks for the reply btw.
 
Old 11-29-2013, 08:22 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825
Unless the url points to a web page it is unlikely this would return anything. You mention the server is a clean installation. So was this script accessing a previous sharepoint server?
Is it still available and can you test access on it?

What happens if you enter something like:
Code:
curl -u "domain\user" http://sharepointserver:sharepointport/Sub-site/Library/filename.txt
 
Old 11-29-2013, 08:29 AM   #5
redhatuser1
Member
 
Registered: Sep 2009
Posts: 55

Original Poster
Rep: Reputation: 0
Thanks,

I receive the same result - nothing seems to happen.

The SharePoint server is new, the only key configuration change I can think of there is when I moved the SharePoint databases to another DB Server a few weeks ago.

It is certainly doing something, if I run curl without specifying a port number I do receive a 404 error. I can also receive content when running curl against google and a couple of our other sites...it is just this SharePoint server which doesn't return anything. I am not aware of any configuration required in SharePoint to be honest and I don't have the access I require to upload documents to our other SharePoint servers just now.

---------- Post added 11-29-13 at 08:29 AM ----------

My user is actually a farm administrator (testing purposes), I know I have access to the SharePoint sites.

If I run echo $? after the curl command, it returns 0 suggesting success..however if I try and run
Code:
 curl http://sharepointserver:port/
I receieve the following:
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

Last edited by redhatuser1; 11-29-2013 at 08:57 AM.
 
Old 11-29-2013, 09:20 AM   #6
redhatuser1
Member
 
Registered: Sep 2009
Posts: 55

Original Poster
Rep: Reputation: 0
I am now convinced it is SharePoint security - it seems after adding (-v) into the curl command I am returning a 401 error...

Will switch to solved if I can figure out why.

IIS seems to be rejecting all users (even though I can browse to the site successfully in I.E/Firefox/Chrome)

Last edited by redhatuser1; 11-29-2013 at 09:25 AM.
 
Old 11-29-2013, 10:27 AM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825
hmmm ... the addition of saying that browsers can go there may also imply that a proxy configuration is stopping the access??
 
Old 11-29-2013, 10:36 AM   #8
redhatuser1
Member
 
Registered: Sep 2009
Posts: 55

Original Poster
Rep: Reputation: 0
In the end I have got it working and unfortunately I cannot really confirm what fixed it. Personally I think it was an IIS issue on the SharePoint server as the following command (which I attempted numerous times) is working:

Code:
curl --ntlm -u $USERNAME:$PASSWORD -t $FILES $URL
the addition of --ntlm may not be necessary but I am not taking it out as we go live on the project on Monday and as of right now it is looking good. Thanks for your help.
 
Old 11-29-2013, 01:01 PM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825
Glad you got it working
In case you haven't read all of the man page for curl, this snippet under the -u option may also help:
Code:
If  you use an SSPI-enabled curl binary and perform NTLM authentication, you can force curl to select the user name and password from your environment by simply specifying a single colon with this option: "-u :" or by
              specfying the login options on their own, for example "-u ;auth=NTLM".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cURL: Server has many IPs, how would I make a cURL script use those IPs to send data? guest Programming 0 04-11-2009 12:42 PM
Installed Curl and GD extension and get error: XBM Support required Nickalf Linux - Software 7 02-18-2009 04:22 PM
I need help desperately! kleggett Linux - Newbie 14 04-29-2003 06:56 PM
Need help... desperately. kinginjinn Linux - Hardware 3 11-30-2002 12:39 AM
desperately need drivers! Please, help! Marci Sarwan Linux - Software 2 01-18-2001 12:39 PM


All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration