Sponsored Content
Full Discussion: FTP scripting issue
Top Forums UNIX for Dummies Questions & Answers FTP scripting issue Post 302817119 by MJCreations on Wednesday 5th of June 2013 08:13:12 AM
Old 06-05-2013
Question FTP scripting issue

I dont have enough bits to post in emergency, but I have an urgent FTP issue. A client of ours wants us to pull files from his server onto our server at which point we can process it. I ask a friend what to do, but I was just give the things to do, not how to do it.

I havent written a Unix script before, but I need to understand the basic syntax to FTP a file from a remote server. I've tried to read about it online, but there are sooo many different answers.

I just need to do these things:

Set a parameter to control the dates to be pulled (Script will run Monday-Thursday only) Needs a control file to decide how many files to pull.

pull 3 files from 3 servers with it being 1 file per server usually.
rename these files to add "-A","-B" "-C" on the ends
and then push to our servers. We have four servers

My biggest issue is with variables. I don't know how to use them. I need to call an .sh file to set the variables and then save the last successful run parameter. I don't even know what that means.

Help! I'd be very grateful.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Telnet FTP scripting

Hi quick question from a unix newbie Working on a project to get me using unix, the point of this project is to find a printer on the network check for jobs in the printer if the printer has no jobs do nothing if the printer has jobs then check the status for errors and e-mail the user. This... (2 Replies)
Discussion started by: w33man
2 Replies

2. Shell Programming and Scripting

scripting a ftp process

I am trying to automate a process in one of two ways: 1) ftp .txt files from a unix server to a Windows 2000 server. I want to do this in a script. Can I supply the login and password to the Windows server inside the script? 2) I tried this and failed: sftp .txt files from the unix server to... (2 Replies)
Discussion started by: gbernard
2 Replies

3. Answers to Frequently Asked Questions

Automate FTP / Scripting FTP Transfers

One of our most frequent questions is how to automate ftp transfers. There are several approaches. Since I'm writing this post, we will start with my favorite technique. :) In Automated FTP task I present a simple example of my ksh co-process technique. And note that later in this thread I... (0 Replies)
Discussion started by: Perderabo
0 Replies

4. Shell Programming and Scripting

Error in scripting ftp

Good Morning, I just would like to know what is wrong with my script. I am trying to use a for loop on my ftp command but the part that pipes the ftp information is reported in unix as error. Here's my script : #!/bin/ksh # other parts of the script here.... # get all ORD* files... (10 Replies)
Discussion started by: negixx
10 Replies

5. Shell Programming and Scripting

FTP scripting

Hello, I'm sure this is an easy one for you UNIX pros. I would like to create and and automated an FTP process. The script should do this: 1. Log into a remote system 2. change to a specified directory 3. copy local files to the remote system 4. quit ftp 5. wait until the next schedule ... (7 Replies)
Discussion started by: bbbngowc
7 Replies

6. Shell Programming and Scripting

Ftp scripting question

Hi guys, I'm trying to create an ftp script that will read in a value from input, then search for files with the input value, and then ftp the files.. So far I've got my read answer set up, and it'll ls -lrt out my files with the value read answer var I given it... My question is, what... (14 Replies)
Discussion started by: Jazmania
14 Replies

7. Shell Programming and Scripting

FTP-Shell scripting

Hi Everybody, I have come across a problem while doing FTP using shell scripting. So I request any of you can give some idea of how to go about solving the problem but i request you not to give the solution please. Because i'm a java developer newly into Unix shell progrmming and am very enthu... (1 Reply)
Discussion started by: RSC1985
1 Replies

8. Shell Programming and Scripting

FTP scripting Help

Hi, I'm trying to do an FTP script that will read from a list of files and send only the files in that list. Would this work? Does anyone have anything simpler. ftp -nv <<EOF open server user username password get $(nawk -F_ -f bbb.awk Filelisting.txt) EOF (5 Replies)
Discussion started by: bbbngowc
5 Replies

9. Shell Programming and Scripting

Need FTP scripting

Hi, Please can you tell me the script to transfer file from server A to Server B (1 Reply)
Discussion started by: e1994264
1 Replies

10. Shell Programming and Scripting

Scripting with FTP Process

Hi Guys, Good day ULF! I have a general "auto-ftp" code which looks something like this: #!/bin/sh cd $1 ftp -v -n $2 << EOF user $3 $4 prompt cd $5 bin mput $6 quit EOF This works pretty well, but I'm thinking of how can I make a code by maybe including on this code, for... (5 Replies)
Discussion started by: rymnd_12345
5 Replies
CURLOPT_DIRLISTONLY(3)					     curl_easy_setopt options					    CURLOPT_DIRLISTONLY(3)

NAME
CURLOPT_DIRLISTONLY - ask for names only in a directory listing SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DIRLISTONLY, long listonly); DESCRIPTION
For FTP and SFTP based URLs a parameter set to 1 tells the library to list the names of files in a directory, rather than performing a full directory listing that would normally include file sizes, dates etc. For POP3 a parameter of 1 tells the library to list the email message or messages on the POP3 server. This can be used to change the default behaviour of libcurl, when combined with a URL that contains a message ID, to perform a "scan listing" which can then be used to determine the size of an email. Note: For FTP this causes a NLST command to be sent to the FTP server. Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links. Setting this option to 1 also implies a directory listing even if the URL doesn't end with a slash, which otherwise is necessary. Do NOT use this option if you also use CURLOPT_WILDCARDMATCH(3) as it will effectively break that feature then. DEFAULT
0, disabled PROTOCOLS
FTP, SFTP and POP3 EXAMPLE
TODO AVAILABILITY
This option was known as CURLOPT_FTPLISTONLY up to 7.16.4. POP3 is supported since 7.21.5. RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_CUSTOMREQUEST(3), libcurl 7.54.0 February 03, 2016 CURLOPT_DIRLISTONLY(3)
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy