General discussion

Locked

UNIX FTP

By jerzy_milosiewicz ·
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?

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

UNIX FTP

by cpfeiffe In reply to UNIX FTP

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.

Collapse -

UNIX FTP

by jerzy_milosiewicz In reply to UNIX FTP

The question was auto-closed by TechRepublic

Collapse -

UNIX FTP

by cmorris In reply to UNIX FTP

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

Collapse -

UNIX FTP

by jerzy_milosiewicz In reply to UNIX FTP

The question was auto-closed by TechRepublic

Collapse -

UNIX FTP

by unixadmin In reply to UNIX FTP

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 <filename> If you do't have lsof installed I would suggest getting it installed, because it is an invaluable troubleshooting tool.

Collapse -

UNIX FTP

by jerzy_milosiewicz In reply to UNIX FTP

The question was auto-closed by TechRepublic

Collapse -

UNIX FTP

by dnastudios In reply to UNIX FTP

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

Collapse -

UNIX FTP

by jerzy_milosiewicz In reply to UNIX FTP

The question was auto-closed by TechRepublic

Collapse -

UNIX FTP

by jerzy_milosiewicz In reply to UNIX FTP

This question was auto closed due to inactivity

Back to Linux Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums