How to perform checksum of a file on remote server using Curl?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to perform checksum of a file on remote server using Curl?
# 1  
Old 08-29-2017
Question How to perform checksum of a file on remote server using Curl?

Hi, We have an AIX server and have CURL 7.40 installed in it.

We are struggling to perform checksum on the file present on the remote server (AWS). We want to validate the checksum on the file pre and post download to make sure that there is no issue with the file.

We are writing a shell script and we are using Curl for FTPS connection and downloading the file from AWS to AIX.

I have copied the code snippet that we have written to list the files and download them.

Code:
#list files on AWS server
curl -tlsv1.2 --cacert certs.cer --ftp-ssl --ftp-skip-pasv-ip --list-only --cert ${CERT_USER}:${CERT_USER_PWD} ftp://${USER_NAME}:${USER_PWD}@awscloud.com:50021/Inbox/* > ${LOGS}

#download the files mentioned in the list file
cat ${LOGS} | \
awk '{print $1}' | \
while read FILENAME
do
 echo "File being copied currently is ${FILENAME} "
 curl -tlsv1.2 --cacert certs.cer --ftp-ssl --ftp-skip-pasv-ip --cert ${CERT_USER}:${CERT_USER_PWD} ftp://${USER_NAME}:${USER_PWD}@awscloud.com:50021/Inbox/${FILENAME} -o ${FILENAME}
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

3. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

4. Shell Programming and Scripting

How to create a file in remote server from local server?

hi, can anyone tell me how can i store the names of a file that are in remote server to a file and then get the file that contains the name in local server? there is a remote server where 5 files are present , say a.txt b.txt c.txt d.txt e.txt i want to write a script in my local... (4 Replies)
Discussion started by: Little
4 Replies

5. Shell Programming and Scripting

Curl ftp upload success but no file exist on the server !!!!

hello, I'm trying to upload a file to this ftp server and others ftp://ftp.byethost12.com as you can see in the output of CURL using the -v option curl reports that the upload succeeded but when i connected to the server with file-zilla there is no file uploaded the same command upload files... (5 Replies)
Discussion started by: laraaj
5 Replies

6. Shell Programming and Scripting

checksum of remote server

Hi I am trying to check the successfull transfer of a file from my local server to remote server. I wish to generate a md5 checksum of the file residing on my local server and also generate a md5checksum on the remote server and compare value. I was successfull in generating checksum on local... (2 Replies)
Discussion started by: vasuarjula
2 Replies

7. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

8. Shell Programming and Scripting

Use cURL in shell script and get most recent file from remote server using SFTP

I have been trying to implement the following shell script -- sftp to remote server get list of files in the directory sftp get the most recent listed file exit This script will be scheduled to be executed everyday using CRON or CONTROL-M and the need is to have absolutely no human... (7 Replies)
Discussion started by: toobrown1
7 Replies

9. Shell Programming and Scripting

Transfer file from local unix server to remote server

want to remove this thread. thanks (2 Replies)
Discussion started by: indira
2 Replies

10. HP-UX

Transfer file from local unix server to remote server

want to remove the thread thanks (2 Replies)
Discussion started by: indira
2 Replies
Login or Register to Ask a Question
CURLOPT_PATH_AS_IS(3)					     curl_easy_setopt options					     CURLOPT_PATH_AS_IS(3)

NAME
CURLOPT_PATH_AS_IS - do not handle dot dot sequences SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PATH_AS_IS, long leaveit); DESCRIPTION
Set the long leaveit to 1, to explicitly tell libcurl to not alter the given path before passing it on to the server. This instructs libcurl to NOT squash sequences of "/../" or "/./" that may exist in the URL's path part and that is supposed to be removed according to RFC 3986 section 5.2.4. Some server implementations are known to (erroneously) require the dot dot sequences to remain in the path and some clients want to pass these on in order to try out server implementations. By default libcurl will merge such sequences before using the path. DEFAULT
0 PROTOCOLS
All EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/../../etc/password"); curl_easy_setopt(curl, CURLOPT_PATH_AS_IS, 1L); curl_easy_perform(curl); } AVAILABILITY
Aded in 7.42.0 RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3), CURLOPT_URL(3), libcurl 7.54.0 February 14, 2016 CURLOPT_PATH_AS_IS(3)