I've been working on a back up script for a client, however if I get the size via FTP account, it takes a long time to load the page, was wondering if running a SSH command via PHP would be much quicker? Could anyone tell me what commands would I need to use to determine a folder size in kb?

OR

To get a user quota used? as I have a FTP user for each backup account, so just need to know how much it's using

oen last question, your commands print out every directories size in the folder, how can I just get back the size for the whole thing? I tried using -c but it still includes all of the other folders.. it works if I navigate to the directory and run du -s but then I need to navigate to it and I don't wan't to do that every time.. Would appreciate the help!
–
Saulius AntanaviciusMay 17 '12 at 12:11

I already said this takes to long to load because of that!
–
Saulius AntanaviciusMay 15 '12 at 18:17

"however if I get the size via FTP account" makes it sound like you logged into an FTP server to get the size... if the directory is on the server itself, it could be quick.
–
Taylor JaskoMay 15 '12 at 21:20