IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

FTP to FTP transfer - taking up partial files

  • 1.  FTP to FTP transfer - taking up partial files

    Posted Tue March 25, 2008 03:47 PM

    Hi,

    I have gone through several posts but this one is bit different.

    I have src folder on unix1 machine and target folder on unix2 machine. I have to get . files from src folder and put in target folder.

    challenge here is i cannot create any new folders and have to carry on with ftp…

    In this case i am getting partially completed files from src folder as unix does not lock a file while writing.

    Does anyone has come across like this…

    Regards,
    Sumit


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: FTP to FTP transfer - taking up partial files

    Posted Tue March 25, 2008 04:12 PM

    Yes this is quite typical. The usual approach is for the writing system to write the file with a filename extension, such as .tmp. The system that is polling the directory for files ignores files ending in .tmp. When the writing system is done writing the file, rename the file to remove the .tmp portion. That indicates the file is ready to be picked up.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: FTP to FTP transfer - taking up partial files

    Posted Wed March 26, 2008 07:09 AM

    Hi Rob,

    Yes I totally agree with you. Well this is something I need to check with the src system.

    In the mean time, out of curiosity I have checked this behavior with windows (by copying a big fat 900MB file on ftp dir) and tried ftp mget on the ftp directory and found out that windows do lock file and does not allow file access until its copied completely.

    You have any clue on this.

    Regards,
    Sumit


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 4.  RE: FTP to FTP transfer - taking up partial files

    Posted Wed March 26, 2008 05:53 PM

    Different platforms manage files differently. The only mechanism that is the same on all platforms is a file rename–it is an atomic operation on all platforms. The rename technique will work everywhere.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 5.  RE: FTP to FTP transfer - taking up partial files

    Posted Wed October 08, 2008 01:09 AM

    As a followup on this, even if the OS locks the file, a write-and-rename technique will prevent a partial file from being picked up. If a source system fails or is disconnected for some reason while writing the file, it will never do the rename. So even though the file will be unlocked by the OS, the file is bad. With this rename approach, your process will never see a partial file.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: FTP to FTP transfer - taking up partial files

    Posted Wed February 04, 2009 09:07 AM

    But how to judge the system whether is done writing the file ?


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 7.  RE: FTP to FTP transfer - taking up partial files

    Posted Wed February 04, 2009 07:43 PM

    I’m not sure I understand which system you’re referring to. If you’re referring to the system that is writing the file, it knows when it is done and can then do a rename.

    If you’re referring to the target system (the system that wants to pick up the file after it is ready) the indicator is that the file is renamed to a pattern it is polling for. A rename is an atomic operation that once complete, the file is ready to be open and read by another process.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: FTP to FTP transfer - taking up partial files

    Posted Sat February 21, 2009 04:36 AM

    Reamon .Thanks
    Now , I understand how to control the poll .


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 9.  RE: FTP to FTP transfer - taking up partial files

    Posted Tue May 25, 2010 01:56 PM

    Hi Reamon/ouyiran,

    My requirement is similar to what you quoted here. Src is Unix and target is Unix and I am following the same logic as said by you like renaming the file to abc.xyz. Once it is completely renamed then I am picking the file.
    The issue is sometimes I am getting partially completed files from src folder.

    Please help me out if I am missing something.:confused:

    Regards,
    Datta


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 10.  RE: FTP to FTP transfer - taking up partial files

    Posted Tue May 25, 2010 05:17 PM

    What is the filename pattern the polling port is using? Does it match the filename before the rename is done?


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services