Link to home
Start Free TrialLog in
Avatar of mrbungle50
mrbungle50Flag for Australia

asked on

need to know when file is completed ftp transfer

Hello all again!
I have a system where a file is transferred from a host by FTP to a Solaris machine into a particular directory.
Once this file is fully downloaded, I have set up an FTP process to retrive the file and bring it back ot amy local Linux box.
The problem is.....the file can be quite large and the timing of it arriving on the Unix box is not certain. So I need to know the file is complete before trying to bring it back to the Linux box.
The one thing in favour is the file always has the same line beginning at the end of the file "TRLDOWNLOAD" (no quotes)
So maybe I could search for the end of the file and if it exists start my FTP process?
Is this possible. ps; I cannot FTP backwards from the Sun box to my Linux machine
Thanks in advance
Craig
MrBungle50
Avatar of mikelfritz
mikelfritz
Flag of United States of America image

Sounds like the sun machine needs to indicate the file is done - you would need to get the whole file, using ftp just to know if it's done, if not repeat, repeat...

Can they print the file to you when it's ready?  I have a rather niffty way to make it not print but take the raw data into a file.  SYSV print filters are GOLD and CUPS supports them.  If they can't pump the data out at the end of the job, can they at least give some indication that the file is cooked?

If you have some form of access to the remote, you could whip up an expect script to get in and check for doneness, and signal yourself by some mundane or creative means, then kick an ftp transfer (scripted as well), or some other transit mech.

Avatar of mrbungle50

ASKER

Thanks Mikel,
I'll start looking into "expect scripts" and see what Ican come up with.
Cheers
Craig
MrBungle50
http://expect.nist.gov/

there are rpm's and gzip'ed tars out there. Very usefull.
Avatar of Tintin
Tintin

Do you have any control of the initial FTP process to the Solaris box?  A common way to do this is to upload the file with a temporary name and then rename it when the file transfer is complete.

Do you have ssh available on the Solaris box?
You may ftp the file to a dir1 and once completed move it to dir2 from which you ftp to other servers
ASKER CERTIFIED SOLUTION
Avatar of Steve Jennings
Steve Jennings

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys  I am going on the advice to move the file when downloaded fully
Thanks again
sorry for taking so long to get back to you.
Craig
MrBungle50
Hi mrbungle50,

Which part of the answer was accepted?

MrBungle50, you should probably give the points to omarfarid. He's the one who actually suggested the idea of moving the files . . . At the very least, split them.

Good luck,
Steve