1

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?

Martin Prikryl
  • 21,071
  • 9
  • 77
  • 157
jholmie2
  • 13
  • 1
  • 3

2 Answers2

1

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:password@example.com/" ^
    "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)

Martin Prikryl
  • 21,071
  • 9
  • 77
  • 157
-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

Hastur
  • 18,764
  • 9
  • 52
  • 95
MilesWeb
  • 124
  • 2
  • 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. – Hastur Dec 09 '14 at 14:51
  • Thank you so much , I searched for available commands for mget , but couldn't find the skip option! – jholmie2 Dec 09 '14 at 14:54
  • 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 Dec 09 '14 at 15:48
  • I used like this > MGET \*.* "C:\My documents\*.*" *skip* and that results with Cannot find list of remote files. – jholmie2 Dec 09 '14 at 15:58
  • ftp> MGET *.* "" skip (idk why I can't put * before . and after here) works but it does not skip files , is the syntax wrong? – jholmie2 Dec 09 '14 at 16:29
  • 1
    The answer uses a completely different `ftp` client than the OP, without bothering to mention it. – Martin Prikryl Jul 30 '15 at 05:58