send file of size 0 with FTP on AIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting send file of size 0 with FTP on AIX
# 1  
Old 05-13-2005
send file of size 0 with FTP on AIX

I'm using IBM AIX 5.2 to send file with ftp to other unix machine.
The command is into a shell:
...
ftp -n > outFtp 2> errFtp <<PARAM
open $2
user $3 $4
put $1 $remote
bye
PARAM
...


then i look at the size of errFtp and outFtp to see if there are some error message.
It works with file of size > 0.
It doesn't works with file of size 0 cose the server return in the standard error (>errFtp) a message like this:
netout: write returned 0?

It's possible to configure server messaging to skip this kind of "warning"?
Other method to check if ftp works fine?

Thanks.
# 2  
Old 05-13-2005
In your script check the file size before you get to ftp:
Code:
let size=`wc -c $myfilename`
if [ $size .gt. 0 ]; then
..... ftp....

fi

# 3  
Old 05-13-2005
Thanks, but i have to send the file, also if the size is 0.
# 4  
Old 05-13-2005
works fine on Solaris - must be AIX [???] server related
# 5  
Old 05-13-2005
yes, i'm porting an application from Solaris 5.8 to AIX 5.2 and i've found the problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

FTP zero size file

Hi AM using unix Aix Ksh I need to clarify regarding sending the zero size file to another server. VAL=ftp.sh -c put souce_file Dest_file $1 $2 $3 $4 $5 $VAL 2 > $ERR When am Sending the Zero Size File getting alerts netout write returned Zero. But i would like to know $VAL... (4 Replies)
Discussion started by: Venkatesh1
4 Replies

2. Shell Programming and Scripting

FTP a huge Size file

Dear All, Good Evening!! I have a requirement to ftp a 220GB backup file to a remote backup server. I wrote a script for this purpose. But it takes more than 8 hours to transfer this file. Is there any other method to do it in less time??? Thanks in Advance!!! ---------- Post updated... (5 Replies)
Discussion started by: Naga06
5 Replies

3. Shell Programming and Scripting

Script to read file size and send email only if size > 0.

Hi Experts, I have a script like $ORACLE_HOME/bin/sqlplus username/password # << ENDSQL set pagesize 0 trim on feedback off verify off echo off newp none timing off set serveroutput on set heading off spool Schemaerrtmp.txt select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Discussion started by: welldone
5 Replies

4. UNIX for Dummies Questions & Answers

FTP - need to send error to txt file

I've written a script to FTP files into a directory, perform a diff between the current and the previous and email out the results. Sometimes a machine falls off the network and needs to be rebooted to reconnect. Obviously I don't get the file I want at that time. How do I get the FTP error to be... (1 Reply)
Discussion started by: scanner248
1 Replies

5. Shell Programming and Scripting

FTP - need to send error to txt file

I've written a script to FTP files into a directory, perform a diff between the current and the previous and email out the results. Sometimes a machine falls off the network and needs to be rebooted to reconnect. Obviously I don't get the file I want at that time. How do I get the FTP error to... (0 Replies)
Discussion started by: scanner248
0 Replies

6. Shell Programming and Scripting

How to compare file size after ftp?

Is possible if I want to campare file size on source and destination after ftp transfer? If anybody know, please explain to me. (1 Reply)
Discussion started by: icemania
1 Replies

7. Shell Programming and Scripting

How send a file from UNIX to Windows with FTP

Hi I'm new working in UNIX, So, I want to know How I can send a file from UNIX to Windows server with FTP. This is my script. ftp -i -n -v <<** open 199.99.99.99 user user1 password1 lcd C01_07_06 /* source/ cd //199.98.98.98/group1/reports /*destination*/ put file1.sh ... (1 Reply)
Discussion started by: edzela
1 Replies

8. UNIX for Dummies Questions & Answers

Send a file by ftp

Hello! Is there any chance that this single line command execute properly on aix? I have 0 knowledge on that platform!! echo "User_FTP \nFTP_PASSWORD \nbin \ncd cad \nput /opt/lotus/office/general/Agent.csv \nquit" | ftp abc0.cie.com If not, any other suggestion? A single line command... (4 Replies)
Discussion started by: jr_provost
4 Replies

9. UNIX for Dummies Questions & Answers

ftp hangs on file size = 0

I have an ftp process which runs every 10 minutes between Unix and an NT box. Normally it works, but when the script tries to get a file from NT that has a length of 0, the ftp process hangs (as if it is still waiting for the end of the file). This is the script... (3 Replies)
Discussion started by: mheinrich
3 Replies

10. UNIX for Advanced & Expert Users

ftp file size

how to compare file size which has been received through ftp get from a remote location with local copy available any clue regards (5 Replies)
Discussion started by: sathiya
5 Replies
Login or Register to Ask a Question