Ftp Error Handling
Contents |
Search Username Password Remember Me? Register Lost Password? facebook google twitter rss Free Web Developer Tools Advanced Search Forum Operating Systems UNIX Help How to trap ftp ftp error codes success/failure Thread: How to trap ftp success/failure Share This Thread Tweet ftp return codes unix This + 1 this Post To Linkedin Subscribe to this Thread Subscribe to This Thread September 22nd, 2004,09:58 ftp return codes mainframe AM #1 No Profile Picture AVS View Profile View Forum Posts Contributing User Devshed Newbie (0 - 499 posts) Join Date Aug 2004 Posts 37 Rep Power sftp error codes 13 How to trap ftp success/failure Hi, I am doing the following ftp -in $host << EOF_MYFTP user $user $password cd $dest_dir put $dest_file yourftp.fil EOF_MYFTP I want to know if really 'put' has succeeded in putting the file to destination. If for any reason the file is not put in destination [maybe due to problems in destination server like space
How To Check If Sftp Is Successful In Unix
constraint, etc] I need to know that. I just need to know if it has succededd or failed and I dont want to know why it din't. Based on the failure I will exit this prog with exit code 1 and if it is success I want to exit with exit code 0. Is there any way? Thanks Faq Reply With Quote September 23rd, 2004,01:17 AM #2 No Profile Picture guggach View Profile View Forum Posts Contributing User Devshed Beginner (1000 - 1499 posts) Join Date Jul 2004 Location Middle Europa Posts 1,198 Rep Power 16 ftp is very avaricious with exit codes, it's printing messages a way is collect and check the output, like: ftp -in $host << EOF_MYFTP >result user $user $password cd $dest_dir put $dest_file yourftp.fil EOF_MYFTP then using grep|sed or what ever, analize the 'result' file don't forget a 'bye' or 'quit' before EOF_MYFTP - a second way is to use a better ftp: google for 'ncftp' it's really better btw: ftp can get probls running in 'passive' mode, not ncftp.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about
Ftp 550
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask ftp code Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. ftp shell script Join them; it only takes a minute: Sign up FTP Error Handling up vote 0 down vote favorite 1 I have a KornShell (ksh) script which writes out FTP script and executes to get some files from windows server http://forums.devshed.com/unix-help-35/trap-ftp-success-failure-185613.html to UNIX. echo "user
good, bad or incomplete: Range Purpose 1xx Positive Preliminary reply The requested action is being initiated; expect https://en.wikipedia.org/wiki/List_of_FTP_server_return_codes another reply before proceeding with a new command. (The user-process sending http://www.unix.com/shell-programming-and-scripting/246790-script-ftp-maintain-error-handling.html another command before the completion reply would be in violation of protocol; but server-FTP processes should queue any commands that arrive while a preceding command is in progress.) This type of reply can be used to indicate that the command was accepted and the ftp error user-process may now pay attention to the data connections, for implementations where simultaneous monitoring is difficult. The server-FTP process may send at most, one 1xx reply per command. 2xx Positive Completion reply The requested action has been successfully completed. A new request may be initiated. 3xx Positive Intermediate reply The command has been accepted, ftp error codes but the requested action is being held in abeyance, pending receipt of further information. The user should send another command specifying this information. This reply is used in command sequence groups. 4xx Transient Negative Completion reply The command was not accepted and the requested action did not take place, but the error condition is temporary and the action may be requested again. The user should return to the beginning of the command sequence, if any. It is difficult to assign a meaning to "transient", particularly when two distinct sites (Server- and User-processes) have to agree on the interpretation. Each reply in the 4xx category might have a slightly different time value, but the intent is that the user-process is encouraged to try again. A rule of thumb in determining if a reply fits into the 4xx or the 5xx (Permanent Negative) category is that replies are 4xx if the commands can be repeated without any change in command form or in proper
Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here. Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... linux operating commands and unix operating commands Script FTP maintain error handling Shell Programming and Scripting Thread Tools Search this Thread Display Modes #1 04-28-2014 edydsuranta Registered User Join Date: Aug 2012 Last Activity: 9 January 2015, 1:24 AM EST Posts: 27 Thanks: 3 Thanked 0 Times in 0 Posts Script FTP maintain error handling Hi, I have ftp script like below Quote: #!bin/sh #***** Set local working directory ***** cd /path/to/script/and/files #***** Set ftp server, credentials, and file(s) to search for ***** HOST='SERVERADDRESS' USER='FTPUSERNAME' PASSWD='FTPPASSWORD' FILE='FTP_*.dat' #***** Send files to FTP server ***** ftp -vn $HOST <