using curl in a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting using curl in a script
# 1  
Old 04-22-2010
using curl in a script

Hello everyone

I'm currently using a script to upload files (different file names, but same date) to an ftp server (see below)

Code:
#!/bin/sh

# Set the variables
HOST=<host>
USER=<user>
PASSWD=<password>

ftp -i -n $HOST <<END_SCRIPT 
user ${USER} ${PASSWD}
mput cbl_client_interface_${DATE}.csv
quit
END_SCRIPT

exit 0

Now I've been given the task to use the "ftps" protocol to upload the files. I've been advised to use the "curl" utility.

It is possible to use curl with ftps to transfer files like in the example above?

P.S. I'm using Solaris 10
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Curl not accepting spaces in script via variables

Hi All, I'm trying to run a script which issues rest commands via curl to an endpoint. If I put spaces in fields via something like insomnia, it works, but when I try from an input file, it's failing with a json error. while IFS=, read mname oname <------ my input file... (10 Replies)
Discussion started by: say170
10 Replies

2. Shell Programming and Scripting

Using curl in bash script

Hello. I have pick up a script from internet to track errors from curl command. #!/bin/bash # URL_TO_TEST="http://www.xxxxxx.yyy" MY_VAR=curl_init("$URL_TO_TEST") ; curl_setopt($MY_VAR, CURLOPT_HEADER, 1); curl_setopt($MY_VAR, CURLOPT_RETURNTRANSFER, 1); curl_setopt($MY_VAR,... (2 Replies)
Discussion started by: jcdole
2 Replies

3. Shell Programming and Scripting

Script containing Curl doesn't run with crontab

Hello I have a problem with the crontab command when I run a code containing Curl on the command line it runs without fail but as soon as I program it with crontab it executes everything except the curl returns fail thank you for helping me to resolve this problem because since Monday I look... (14 Replies)
Discussion started by: beautymind
14 Replies

4. Shell Programming and Scripting

Rest APIs without curl in shell script

We are not allowed to install curl on our linux box. Is there any other way to talk to Rest API's in shell script rather than using curl ? - Please advise - thank you (3 Replies)
Discussion started by: rv_champ
3 Replies

5. Shell Programming and Scripting

Using CURL in a script

Hi all so I'm new to scripting but I am making a script that is a url shortener. It will take a url off the command line and spit back the shortened version using bit.ly's api this is what I have so far if then echo "You must supply a URL." exit 1 fi read url... (3 Replies)
Discussion started by: subway69
3 Replies

6. Shell Programming and Scripting

curl into a shell script (variable transmission): need help

Hey I'm writting a little shell script, and I started using curl with it today. I would like to login into a website using curl (--data argument). This part is working, curl sent me the webpage that we see when we log in this website. Problem: This is a temporary page. When I log in this... (0 Replies)
Discussion started by: Link_
0 Replies

7. Shell Programming and Scripting

curl ftp script

Hello - I'm a novice, so apologies if this is a stupid/answered question. I'm operating on a mac, and I'm using ftp to transfer files to my computer. The files have atypical names, although I have a list of them, addresses included. Is there a way to automate this using curl? That is to... (3 Replies)
Discussion started by: Qroid
3 Replies

8. Shell Programming and Scripting

Bash script idea using cUrl -- possible?

I have an alias already in my .bash_profile to download files using cUrl's -o (output to file, user provides the file name) option. I find I'm using it quite a bit, so I wanted to write a script to run "curl -o", taking the necessary inputs - file name and URL from which to download - and then... (3 Replies)
Discussion started by: SilversleevesX
3 Replies

9. Shell Programming and Scripting

using curl with shell script.

hi please help me out here, i want to use curl command in shell script to test web pages, what i have is an opening page, when i click on a button on opening page, the next page comes up and then i have to upload a file n then click another button to submit and then comes the output... (0 Replies)
Discussion started by: ankushg002
0 Replies

10. Shell Programming and Scripting

script to output curl result as html

hi, new to scripting and would like to know how can I have a script which will curl a few URLs and have the results such as the URLs being curled, dns lookup time, connection time, total time, etc save in a html format in a form of table with column and rows. thank you. (4 Replies)
Discussion started by: squidusr
4 Replies
Login or Register to Ask a Question
CURLOPT_RESUME_FROM(3)					     curl_easy_setopt options					    CURLOPT_RESUME_FROM(3)

NAME
CURLOPT_RESUME_FROM - set a point to resume transfer from SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESUME_FROM, long from); DESCRIPTION
Pass a long as parameter. It contains the offset in number of bytes that you want the transfer to start from. Set this option to 0 to make the transfer start from the beginning (effectively disabling resume). For FTP, set this option to -1 to make the transfer start from the end of the target file (useful to continue an interrupted upload). When doing uploads with FTP, the resume position is where in the local/source file libcurl should try to resume the upload from and it will then append the source file to the remote target file. If you need to resume a transfer beyond the 2GB limit, use CURLOPT_RESUME_FROM_LARGE(3) instead. DEFAULT
0, not used PROTOCOLS
HTTP, FTP, SFTP, FILE EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com"); /* resume upload at byte index 200 */ curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 200L); /* ask for upload */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* set total data amount to expect */ curl_easy_setopt(curl, CURLOPT_INFILESIZE, size_of_file); /* Perform the request */ curl_easy_perform(curl); } AVAILABILITY
Always RETURN VALUE
Returns CURLE_OK SEE ALSO
CURLOPT_RESUME_FROM_LARGE(3), CURLOPT_RANGE(3), CURLOPT_INFILESIZE(3), libcurl 7.54.0 February 03, 2016 CURLOPT_RESUME_FROM(3)