Sponsored Content
Full Discussion: Retry upon FTP failure
Top Forums Shell Programming and Scripting Retry upon FTP failure Post 302386740 by phudgens on Wednesday 13th of January 2010 11:09:43 AM
Old 01-13-2010
Retry upon FTP failure

I am using the following code in a C Shell script to transfer files to a remote server:
Code:
 
ftp -n logxx.xxxx.xxx.xxx.com <<DO_FTP1
quote user $user_name
quote pass $password
ascii
put $js_file_name
bin
put $FinalZipFile
quit
DO_FTP1

This code works great except on those rare occasions when the remote server is down or, for whatever reason, fails. This causes my code to fail and makes my already tense users angry. This code runs on both Unix and Linux. Is there a way to force a retry after a specified time period if there is a failure of the ftp command? Also, is there a way to make the hash mark print at something other than every 8192 bytes (something more like every GB)?

Thanks,
Paul Hudgens
Denver

Last edited by Scott; 01-13-2010 at 06:11 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Determining the failure or success of FTP

Hi there, I am in the process of writing a shell script to transfer files to a remote directory. Is there a method to determine the success or the failure of the ftp process. Regards Jim (4 Replies)
Discussion started by: JimJim
4 Replies

2. Shell Programming and Scripting

retry process in ftp

hi #!/bin/bash SERVER=10.89.40.35 USER=xyz PASSWD=xyz ftp -in $SERVER<<EOF user $USER $PASSWD mkdir PPL cd /path of remote dir lcd /path of local dir hash bin put <file name> bye <<EOF The above ftp script i have to schedule in crontab at a particular instance of time run daily.... (2 Replies)
Discussion started by: rookie250
2 Replies

3. UNIX for Dummies Questions & Answers

failure writing network systems-ftp error

Hi, I tried to do a ftp get process from linux server to a remote system.It was giving an error 'failure writing network systems'.I am trying to ftp two files,one among them is successful and this problem occurs only if i run the code through 'cron' ie,manual run ends successfully. Would... (0 Replies)
Discussion started by: DILEEP410
0 Replies

4. IP Networking

Automate FTP process and autorestart on link failure

Hi Guys, i have this lil challenge; i am to implement an automated script that searches/scans a directory for files then picks and sends this files to a very remote server via an ftp link. the challenge here is that the ftp link fails due to netwrk issues maybe; i therefore need to develop... (5 Replies)
Discussion started by: sdcoms
5 Replies

5. IP Networking

FTP failure due to network problem

Hi, I've been searching through out this forum to find the exact message when during the on-going FTP, suddenly the network went down but i cannot find some. Could anyone provide me the exact return codes when FTP failed during FTP or prior to FTP the network went down and you still proceeded to... (3 Replies)
Discussion started by: vibora
3 Replies

6. Shell Programming and Scripting

FTP failure with different scenario

Hi Gurus the below FTP code works fine, but the issue is from past 1 week couldn't able to send the files to external system. #--------------------------------------------------------------------# #Start the ftp session #--------------------------------------------------------------------#... (3 Replies)
Discussion started by: SeenuGuddu
3 Replies

7. UNIX for Dummies Questions & Answers

boot up failure unix sco after power failure

hi power went out. next day unix sco wont boot up error code 303. any help appreciated as we are clueless. (11 Replies)
Discussion started by: fredthayer
11 Replies

8. Shell Programming and Scripting

If then else - Retry operation

I need to read a file line by line, then depending on the contents of each line, type in a code that will get written to an array. The problem I have is when I ask the user to confirm the input code, if it is wrong, how do i Return to ask again? Any thing I try increments the file to the next... (6 Replies)
Discussion started by: kcpoole
6 Replies

9. Shell Programming and Scripting

Script to retry FTP commands if unsuccessful and capture the failure status code.

I am using the below code to ftp file onto another server FTP_LOG_FILE=${CURR_PRG_NAME}- ${FTP_FILE}-`date +%Y%m%d%H%M%S`.log ftp -ivn ${FTP_HOST} ${FTP_PORT} << ENDFTP >> ${EDI_LOG_DIR}/${FTP_LOG_FILE} 2>&1 user ${FTP_USER} ${FTP_PSWD} lcd... (2 Replies)
Discussion started by: akashdeepak
2 Replies

10. UNIX for Advanced & Expert Users

FTP failure

Hi, We have a external vendor (outside firewall), who used to connect our ftp server till 2 days back. I am not able to figure out, what was changed. Now he is not able to login. When I login to ftp server (from inside firewall), I am able to connect with credentials. When that vendor login... (4 Replies)
Discussion started by: solaris_1977
4 Replies
callerid.conf(5)					    Linux System Administration 					  callerid.conf(5)

NAME
/etc/isdn/callerid.conf - config file for isdnlog numbers and scripts FORMAT
This file has the format described in isdnformat(5). It must be owned by root, and only root may have write access. Every user can create his private telephone book as ~/.isdn with the same file format. VARIABLES SECTION
Like in isdn.conf, this file has an optional [VARIABLES] section. All variable names must be uppercase. Warning: variables in callerid.conf will override variables in isdn.conf, and variables in ~/.isdn will override variables in both files. First all variables are read, then they are substituted, so a variable defined in ~/.isdn can be used in isdn.conf. This might be a security hole. However, if programs are to be run as root, these files (and the program) cannot be writeable for non-root users. Using variables: if a reference to a non existing variable is used, isdnrep and isdnlog will give warning messages, and use the variable name (e.g if $FRED isn't set, isdnlog will use "$FRED"). The dollar sign can be backslashed if a real dollar sign is needed instead of variable substitution (e.g. $PATH will be "$PATH"). NUMBER and MSN In [NUMBER] sections, you can supply information for the outer world, in [MSN] sections; you can supply information about your msns. The format is the same: NUMBER=xxxx Set the telephone number. This should be your msn or the telephone number with area code (with or without areprefix, countrycode and countryprefix) SI=x Service indicator. Isdnlog knows these service indicators: 1 speech (telephone, fax g3, modem etc.) 2 restricted digital information 3 unrestricted digital information with tones/announcements 4 video 7 unrestricted digital information (hdlc, x.75 etc.) Alias=xxxx Supply a name as alias (e.g. ALIAS=Fred's Number) ZONE=xxx Only useful with remote numbers: billing zone for connections to this number: 0 internal connection in your s0 bus (no charge) 1 city area 2 region 50 3 region 200 4 far region 5 the same as 1 INTERFACE=xxx Isdn network interface. This information is required with the "-hx" / hangup="value" option. START You can define a subsection here. The whole section is ignored unless you gave the "-S" / start=yes option. Each subsection should have the name [FLAG]. It may hold these values: FLAGS=x|y|z Combine these flags (with or without the pipe "|" char; with is preferred) to get the combination you want: Part 1: Incoming and Outgoing I Incoming call O Outgoing call Part 2: Signals from isdn system C Connect (can be used with interval, see below) B Busy E Error R Ring (can be used with interval, see below) A AOCD (advice of charge signal) H Hangup Part 3: Modifiers L Start the program again and again every time it terminates. U Start the program only once within a interval. Without this, several instances of a program can run in parallel. (Interval required.) K Kill program at the end of the interval. USER=xxx Isdnlog will not run programs as root, and will switch to a different user id for security. You must give the name or uid of the user isdnlog has to use here. GROUP=xxx Isdnlog will not run programs as group root, and will switch to a different group id for security. You must give the name or gid of the groups isdnlog has to use here. TIME=xx Restrict this flag to a special time. Pleas read isdntime(5). INTERVAL=xx With connect (C) or ring (R) flag you can specify an interval, so isdnlog will start the program after every interval. The interval is in seconds and should be at least 2 seconds. If the flags do not include C or R, this option is ignored. PROGRAM=xxx The program you want to start, with the required arguments. You may use the following special tokens: $1 flags that caused execution, e.g. "IR", "OC". There are always exactly two characters. $2 Caller number (complete with area code). $3 Called number (complete with area code). $4 Time the connection started. Example: "Wed May 28 23:07:44 1997". Contains "?" if there is no connection yet (e.g. still at RING phase). $5 Duration of connection up to now (in seconds). $6 Time the connection ended. Same format as $4. $7 Number of input bytes. $8 Number of output bytes. $9 Input bytes per second. $10 Output bytes per second. $11 Service indicator. $12 Charges. $13 Caller country code. $14 Called country code. $15 Caller area code. $16 Called area code. $17 Caller town (derived from area code). $18 Called town $19 Caller alias. $20 Called alias. Note: within a string you must use ${1} ${2} ... FILES
/etc/isdn/callerid.conf This file. ~/.isdn Per user telephone book. SEE ALSO
isdnlog(8) isdnformat(5) isdntime(5) AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>, for Debian GNU/Linux and isdn4linux. ISDN 4 Linux 3.13 2000/09/15 callerid.conf(5)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy