1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FTP Commands

Discussion in 'Windows XP' started by Waldy, Aug 18, 2010.

  1. Waldy

    Waldy Flightless Bird

    Hi there,
    this is not strictly an XP issue but I could see anywhere
    obvious to post.

    I am using the FTP command to periodically download and upload files. For
    the download, I am issuing an mget * and then an mdelete * command, The
    problem with this is that there is the potential for a file to arrive in the
    remote folder between the download and deletion commands, meaning that files
    can be missed.

    Anyone have a more elegant solution?
     
  2. Nil

    Nil Flightless Bird

    On 18 Aug 2010, "Waldy" <someone@microsoft.com> wrote in
    microsoft.public.windowsxp.general:

    > I am using the FTP command to periodically download and upload
    > files. For the download, I am issuing an mget * and then an
    > mdelete * command, The problem with this is that there is the
    > potential for a file to arrive in the remote folder between the
    > download and deletion commands, meaning that files can be missed.
    >
    > Anyone have a more elegant solution?


    How about using a different tool than Microsoft's FTP, like WGET. You
    could invoke WGET twice, the second time with the "-N," or
    "--timestamping" switch. It will retrieve only the files that are newer
    or weren't there the first time.

    WGET can retrieve files by both FTP and HTTP.

    <http://www.gnu.org/software/wget/manual/wget.html#Time_002dStamping>

    <http://gnuwin32.sourceforge.net/packages/wget.htm>
     
  3. Dan Rogers

    Dan Rogers Flightless Bird

    Depending on how good a script writer you are you can do this in a script:
    1. log on to the ftp site
    2. mget the files
    3. log off ftp
    4. redirect a "dir" list of the files to a temp file
    5. massage the temp file into a list of ftp "del" commands.
    6. log back onto the ftp site and use the temp file as a command file (-s
    option)

    This would be doable but painful in cmd shell, maybe not so bad in vbscript,
    very easy in a *NIX shell such as bash.

    DR

    "Waldy" <someone@microsoft.com> wrote in message
    news:%23hj%23nftPLHA.2064@TK2MSFTNGP05.phx.gbl...
    > Hi there,
    > this is not strictly an XP issue but I could see anywhere
    > obvious to post.
    >
    > I am using the FTP command to periodically download and upload files. For
    > the download, I am issuing an mget * and then an mdelete * command, The
    > problem with this is that there is the potential for a file to arrive in
    > the remote folder between the download and deletion commands, meaning that
    > files can be missed.
    >
    > Anyone have a more elegant solution?
    >
     

Share This Page