Determining the failure or success of FTP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Determining the failure or success of FTP
# 1  
Old 11-30-2004
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
# 2  
Old 11-30-2004
Re: Determining the failure or success of FTP

Quote:
Originally posted by JimJim
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
Are you asking if there is a process to CHECK that the ftp transfer went through?

OR

Are you asking if the data that was sent during the ftp transfer is valid - and - can you check for that?
# 3  
Old 11-30-2004
Re: Re: Determining the failure or success of FTP

Quote:
Originally posted by kapolani
Are you asking if there is a process to CHECK that the ftp transfer went through?

OR

Are you asking if the data that was sent during the ftp transfer is valid - and - can you check for that?
Hi there,

The case exactly as follows, I am sending data to a directory which might could get full, in this case if the shell script is transferring files it will fail, at this point I want to know if the process will fail.

Regards
# 4  
Old 11-30-2004
Simple E.g. with 1 file and 1 liner
======================
echo "put $FILE" | ftp $SRVNM # Only one file here

if test `echo "ls $FILE" | ftp $SRVNM | grep -v "No such file or directory" | grep -c $FILE` -ne 1; then

echo "$FILE not at $SRVNM"

fi
# 5  
Old 12-01-2004
Log the messages from the ftp session, then grep for success, e.g...

ftp <<! > /tmp/ftpout.$$
: put file
!
grep -q 226 /tmp/ftpout.$$ || echo error

Note that this method only works if you are sending one file at a time.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script to execute Oracle procedure and trigerring email on success and failure

Here is the shell script which need to trigger a stored procedure and when the record count is 0 then it should capture in the log that 0 duplicate records are found and if it's more than 0 then log with no of records. Also if there is any sqlerror then it should write the same in the log file and... (17 Replies)
Discussion started by: senmng
17 Replies

2. 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

3. Red Hat

Fedora 19 "useradd" failure, GUI success

Hey guys/gals, I have a Fedora 19 box with a 26TB RAID set mounted as my home directory # mount|grep home /dev/md0 on /home type xfs (rw,relatime,seclabel,attr2,inode64,logbsize=128k,sunit=256,swidth=3584,noquota) I have been able to add/modify user accounts using VNC +... (4 Replies)
Discussion started by: jjinno
4 Replies

4. Shell Programming and Scripting

How to write SCP success or failure to a file

Does anyone know how to write the results (success and failure) to a file. I am using TCSH on a Solaris machine. I have the following code for a successful SCP...could someone help me add to this so it caputres failures also? CODE SO FAR (received from a previous post): scp sourcefile.txt... (3 Replies)
Discussion started by: thibodc
3 Replies

5. Shell Programming and Scripting

Curl ftp upload success but no file exist on the server !!!!

hello, I'm trying to upload a file to this ftp server and others ftp://ftp.byethost12.com as you can see in the output of CURL using the -v option curl reports that the upload succeeded but when i connected to the server with file-zilla there is no file uploaded the same command upload files... (5 Replies)
Discussion started by: laraaj
5 Replies

6. Shell Programming and Scripting

Success/failure status of telnet connection

Hi, I am running a shell script which will spawn the telnet and login. But sometimes, the telnet session itself is not getting spawned. My requirement is, if the telnet session is not spawned, the user must be notified that it failed. Is there any command to capture the status of telnet... (2 Replies)
Discussion started by: merin
2 Replies

7. Shell Programming and Scripting

Automating telnet checking for success/failure

Hi I wanna automate the telnet process for port connection.. # telnet 0 port_number Trying 0.0.0.0... Connected to 0. Escape character is '^]'. If its connected how to make it disconnect automatically.. And how to check for success or failure.. (0 Replies)
Discussion started by: ningy
0 Replies

8. Shell Programming and Scripting

Retry upon FTP failure

I am using the following code in a C Shell script to transfer files to a remote server: 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... (8 Replies)
Discussion started by: phudgens
8 Replies

9. UNIX for Advanced & Expert Users

Capturing sendmail success/failure?

I am working on a project that will use sendmail to send reports form a shell script. Since these reports are very important and go out at all times of the day, I need to be able to capture if sendmail is unsuccessful or errors out. The emails may have multiple recipients with multiple attachments.... (2 Replies)
Discussion started by: ssracer
2 Replies

10. Shell Programming and Scripting

FTP Transfer Success

Hi I'm using Shell script which will ftp (download) a file from a host. I need to check whether the file has been transfered completley or not. Can anyone tell me how to do that? Thanks Ben (1 Reply)
Discussion started by: abrd600
1 Replies
Login or Register to Ask a Question