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
mrbungle50Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mikelfritzCommented:
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.

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

there are rpm's and gzip'ed tars out there. Very usefull.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

TintinCommented:
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?
0
omarfaridCommented:
You may ftp the file to a dir1 and once completed move it to dir2 from which you ftp to other servers
0
Steve JenningsIT ManagerCommented:
omarfarid has a good idea, just move the file to a different directory after the ftp is complete. That way you can simply check for the existence of the file periodically.

Personal opinion . . . stay away from expect scripts. They're ok for prototyping or home use, but they don't have any place in a production environment.

Good luck,
Steve
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrbungle50Author Commented:
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
0
omarfaridCommented:
Hi mrbungle50,

Which part of the answer was accepted?

0
Steve JenningsIT ManagerCommented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.