Copy large files from server to server

Discussion in 'Java' started by Chris, Dec 21, 2006.

  1. Chris

    Chris Guest

    What's the best way to copy files from a central server to remote servers?

    Our app runs on multiple app servers, so I can control code running on
    both ends. I've got no guarantee, however, that the central server will
    be able to map or mount remote drives, so doing a simple file copy is
    not an option.

    My first thought was to package up the file into a POST request and send
    it that way. A servlet on the receiving end could handle it correctly.
    The trouble is that sometimes app servers have a maximum post size, and
    my files could be quite large. Another way would be to send a URL, and
    have the remote server pull it from the central server. The trouble with
    that approach is error handling; how will I know if there was an error
    and the process needs to be restarted?

    Is there a guaranteed way to do a file transfer?
     
    Chris, Dec 21, 2006
    #1
    1. Advertising

  2. "Chris" <> wrote in message
    news:458b1e31$0$1612$...
    > What's the best way to copy files from a central server to remote servers?
    >

    rcp or scp, ftp if you must.

    > Is there a guaranteed way to do a file transfer?


    there are no guarantees in a networked environment. The other machine could
    crash halfway through, yours could crash, the network could go down, latency
    could cause major packet loss, EMP could cause corruption, someone could cut
    a cable or trip over one (had that happen once at a customer, maintenance
    tech tripped over the powercord to a mainframe, unplugging the connection
    between it and its UPS with predictable results...), construction crews
    could cut the cables digging up the street (happens more often than you'd
    think), solar flares could take out the comsats you use for your uplink, and
    any of a million other causes could cause the transfer to be interrupted.
    It's in fact a minor miracle it usually works out just fine.
     
    Jeroen Wenting, Dec 22, 2006
    #2
    1. Advertising

  3. Chris wrote:
    > What's the best way to copy files from a central server to remote servers?
    >


    In my view, the "best" Protocol for Transferring Files is likely to be
    the File Transfer Protocol (FTP).

    FTP supports the resumption of interrupted transfers.

    There must be many FTP client libraries for Java ... Google finds
    http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html which is
    an elderly review of some of them.

    Otherwise I'd consider programs like rsync, but that's off-topic.
     
    RedGrittyBrick, Dec 22, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Richter
    Replies:
    4
    Views:
    5,473
    Steve Richter
    Apr 18, 2005
  2. Alex
    Replies:
    2
    Views:
    1,242
  3. Replies:
    26
    Views:
    2,128
    Roland Pibinger
    Sep 1, 2006
  4. Developer
    Replies:
    4
    Views:
    714
    Daniel Pitts
    Feb 25, 2009
  5. Clement Ow
    Replies:
    0
    Views:
    121
    Clement Ow
    Apr 4, 2008
Loading...

Share This Page