Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-16-2010, 01:29 PM   #1
Registered: Sep 2008
Location: Mumbai, india
Distribution: ubuntu and hp-unix
Posts: 118

Rep: Reputation: 15
ftp automation script

I have an ftp automation script. This sends a lot of files to a server.

How an error is handled in an FTP automation script ??
Old 07-16-2010, 02:03 PM   #2
Registered: Apr 2002
Location: UK, Sywell, EGBK
Distribution: RHEL, SuSE, CentOS, Debian, Ubuntu
Posts: 60

Rep: Reputation: 20
It is up to you (inside the script) to handle any errors. Commands always return success or failure when the exit, and you can intercept this and take action accordingly.
Shell assigns the exit status of the last command to variable "?".
So, at any point you can see if the last command (that includes ftp) succeeded or failed. Just enter in a terminal screen "echo $?" to see what I mean. The result of 0 means the last command you executed succeeded. The result of anything else, means the last command failed.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP automation question.. mikidouglas Linux - Software 4 02-25-2009 07:56 AM
Automation script vijayan361 Linux - Newbie 7 01-23-2009 06:42 AM
LUKS automation script jippo Linux - Security 6 01-12-2008 12:56 AM
Telnet automation script senthilvael Linux - Newbie 15 11-19-2007 04:38 PM
ftp automation Mad_C Linux - General 12 09-15-2003 08:57 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration