24

After downloading files from a remote UNIX FTP server, you want to verify that you have downloaded all the files correctly. Minimal you will get information similar to "dir /s" command in Windows command prompt. The FTP client runs on Windows.

edygunawan
  • 243
  • 1
  • 2
  • 4

5 Answers5

24

Sadly this was written for Unix/Linux users :/

Personally, I would install CYGWIN just to get Linux binaries of LFTP/RSYNC to work on windows, as there appears not to be anything that competes with it.

As @zadok.myopenid.com mentioned rsync, this appears to be a windows build for it using CYGWIN ( if you manage to be able to get ssh access to the box eventually )

http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp

Rsync is handy in that it will compare everything with check sums, and optimally transfer partial change blocks.


If you get CYGWIN/Linux:

http://lftp.yar.ru/ is my favorite exploration tool for this.

It can do almost everything bash can do, albeit remotely.

Example:

$ lftp mirror.3fl.net.au
lftp mirror.3fl.net.au:~> ls                          
drwxr-xr-x  14 root     root         4096 Nov 27  2007 games
drwx------   2 root     root        16384 Apr 13  2006 lost+found
drwxr-xr-x  15 mirror   mirror       4096 Jul 15 05:20 pub
lftp mirror.3fl.net.au:/> cd games/misc
lftp mirror.3fl.net.au:/games/misc>find
./
./dreamchess/
./dreamchess/full_game/                                                      
./dreamchess/full_game/dreamchess-0.2.0-win32.exe                                      
./frets_on_fire/
./frets_on_fire/full_game/                                                      
./frets_on_fire/full_game/FretsOnFire-1.2.451-macosx.zip                                  
./frets_on_fire/full_game/FretsOnFire-1.2.512-win32.zip
./frets_on_fire/full_game/FretsOnFire_ghc_mod.zip
./gametap_setup.exe
......
lftp mirror.3fl.net.au:/games/misc> du gametap_setup.exe 
32442   gametap_setup.exe
lftp mirror.3fl.net.au:/games/misc> du -sh gametap_setup.exe 
32M     gametap_setup.exe
lftp mirror.3fl.net.au:/games/misc> 
Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Kent Fredric
  • 56,416
  • 14
  • 107
  • 150
  • 9
    If you want to automate this: `lftp -u user,password -e 'find /;bye' host > file_list` or to just get a count of files `lftp -u user,password -e 'find /;bye' host | -wc -l` – camomileCase Jul 31 '12 at 18:58
  • 1
    To get more details, you can also add the `-l` option to `find` in `lftp`: `find -l` and add an optional directory name. – nealmcb May 06 '17 at 23:54
7

Do this :

ls -lR

..................

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
jamesmar
  • 71
  • 1
  • 1
  • 2
    +1, but apparently there is a typo: `ls -R` is working well, while the `1` seems wrong (it removes info from the list and doesn't recurse anymore) – CapelliC Aug 15 '12 at 10:43
  • 1
    I presume you want `ls -lR` (the letter l, not a 1) – nealmcb May 06 '17 at 23:51
4

If you have ssh access, use rsync instead. It is a far better data transfer app.

Grab fuse for your OS and load ftpfs. This will let you mount the remote ftp directory locally and you can use dir /s or any other application you want on it.

Jonah Braun
  • 4,155
  • 7
  • 29
  • 31
2

Assuming you are using simple ftp via command line, Use dir command with -Rl option to search recursively and copy it to a file and then search the file using grep, find or whatever way is supported on your OS.

ftp> dir -Rl education.txt output to local-file: education.txt? y 227 Entering Passive Mode (9,62,119,15,138,239) 150 Opening ASCII mode data connection for file list 226 Transfer complete

SmitaK
  • 21
  • 1
0

You can use ftp.listFiles("directory") from apache-commons-net and can write your own BFS or DFS to fetch all the files recursively.

Raja
  • 305
  • 2
  • 4
  • 14