LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-16-2010, 02:29 PM   #1
lipun4u
Member
 
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, 03:03 PM   #2
alinas
Member
 
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.
 
  


Reply


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 08:56 AM
Automation script vijayan361 Linux - Newbie 7 01-23-2009 07:42 AM
LUKS automation script jippo Linux - Security 6 01-12-2008 01:56 AM
Telnet automation script senthilvael Linux - Newbie 15 11-19-2007 05:38 PM
ftp automation Mad_C Linux - General 12 09-15-2003 09:57 AM


All times are GMT -5. The time now is 08:07 PM.

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