Discussion Locked

UNIX FTP

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do I check in UNIX, if an FTP process has finished output data to a file before I grab that file for the further process?

9 replies

by cpfeiffe

On the box that is receiving the file you can use ps to print the current processes that are running. You should see an in.ftpd process for the ftp connection from the sending server. Once that process is gone the session is complete and you can start using the file.

by cmorris

Note that it is possible for the ftp process to finish without correctly copying the file. If you can check the file size on the remote site you could compare it with the local copy. Some sites provide an additional file with a verification signature. If so, run a virification program locally and see if it is a match.

Sometime, you could just see if the file size is growing keeping in mind that the data is probably being buffered by the system so you won't see file size changing every time some data is transmitted.

Hope this helps

by unixadmin

If you have lsof installed on the unix server you can use lsof to determine if the file is being utilized by another application. lsof | grep If you do't have lsof installed I would suggest getting it installed, because it is an invaluable troubleshooting tool.

by dnastudios

Send the data you want followed by an empty file.
e.g. sending abc.txt of 10000 bytes
put abc.txt
!touch /tmp/abc.chk
put /tmp/abc.chk abc.chk

Only access tha abc.txt file when the abc.chk file has been received.

Note that ftp does not guarantee complete and correct transfer of the data from one system to another.

Best regards,

David

This discussion is closed to new replies.