Get size of folders on an FTP Server recursively

5,553

The du utility will do what you want.

Share:
5,553

Related videos on Youtube

centic
Author by

centic

Updated on September 18, 2022

Comments

  • centic
    centic almost 2 years

    I have an FTP Server where a large number of files/folders are stored.

    I would like to see how much is stored in each of the folders (including it's subfolders). Is there a way to do this? I.e. get a listing of all folders and theirs sizes on the FTP Server.

    Ideally on Linux, Windows also possible.

  • centic
    centic almost 12 years
    I can only access the data via FTP on the Server, but "du only runs locally, so sorry, no, that does not do what I want in my case.
  • Nicole Hamilton
    Nicole Hamilton almost 12 years
    Then you'll need a script that can recursively walk the tree, starting up an FTP session, cd'ing into a directory, doing an ls or dir, parsing the results to find any subdirectories, then repeating.
  • centic
    centic almost 12 years
    hmm, sure I can do that, but that's what I was trying to avoid, I thought there must be some application or tool which can do that without implementing it myself...
  • Nicole Hamilton
    Nicole Hamilton almost 12 years
    I had a similar problem when I wanted to move one of my sites from a hosting service onto my own machine and I wanted to get the timestamps as well. If you're stuck with the FTP interface, you're stuck with just the commands and the behaviors they give you. You get a dir and an ls but they're both brain-dead and don't recurse. I ended up writing a script (but it's nowhere near publishable quality.)
  • Nontenda
    Nontenda over 10 years
    if you use du command with lftp it just does what you need.