Windows FTP - skip file if it already exists

8,504

Solution 1

Kindly refer http://docs.attachmate.com/reflection/ftp/15.6/guide/en/index.htm?toc.htm?7482.htm once. skip option is available in mget.

e.g. you can use the following line

MGET *.* "C:\My documents*.*" skip

Solution 2

The built-in Windows ftp.exe client does not allow you to skip existing files.

You have to use a different FTP client.


For example with WinSCP, you can use following batch file (.bat):

winscp.com /log=ftp.log /command ^
    "open ftp://username:[email protected]/" ^
    "get -neweronly /path/* c:\path\" ^
    "exit"

Note the -neweronly switch. It makes WinSCP download only non-existing file or file that were updated since the last download.

For details see:

(I'm the author of WinSCP)

Share:
8,504

Related videos on Youtube

jholmie2
Author by

jholmie2

Updated on September 18, 2022

Comments

  • jholmie2
    jholmie2 over 1 year

    I have a little script in Windows that opens up a connection to a web server and downloads all the files using mget.

    However, the mget constantly downloads the files even if they already exist.

    Is there an FTP command that can skip already existing files?

  • Hastur
    Hastur over 9 years
    Welcome on superuser. With time links can become obsolete or not working and the related answer will result useless. In order to avoid it try to write the main idea of the link you post.
  • jholmie2
    jholmie2 over 9 years
    Thank you so much , I searched for available commands for mget , but couldn't find the skip option!
  • jholmie2
    jholmie2 over 9 years
    Im confused , how to add the skip option? Say I use mget * to fetch all files , mget * skip don't work , or is my syntax wrong?
  • jholmie2
    jholmie2 over 9 years
    I used like this > MGET *.* "C:\My documents*.*" skip and that results with Cannot find list of remote files.
  • jholmie2
    jholmie2 over 9 years
    ftp> MGET . "" skip (idk why I can't put * before . and after here) works but it does not skip files , is the syntax wrong?
  • Martin Prikryl
    Martin Prikryl almost 9 years
    The answer uses a completely different ftp client than the OP, without bothering to mention it.