Get size of folders on an FTP Server recursively
5,553
The du
utility will do what you want.
Related videos on Youtube
Author by
centic
Updated on September 18, 2022Comments
-
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 almost 12 yearsI 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 almost 12 yearsThen you'll need a script that can recursively walk the tree, starting up an FTP session,
cd
'ing into a directory, doing anls
ordir
, parsing the results to find any subdirectories, then repeating. -
centic almost 12 yearshmm, 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 almost 12 yearsI 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 anls
but they're both brain-dead and don't recurse. I ended up writing a script (but it's nowhere near publishable quality.) -
Nontenda over 10 yearsif you use du command with lftp it just does what you need.