[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

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
0
mrbungle50
Asked:
mrbungle50
  • 2
  • 2
  • 2
  • +2
1 Solution
 
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
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
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
 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now