ftp
Table of Contents
FTP
Advanced FTP Commands
quote SITE HELP //shows all available SITE FTP commands
quote SITE QUOTA //shows quota
More Info: http://incubator.terra-intl.com/projects/ftpserver/site_cmd.html
Calculate Disk / Directory Usage on FTP Server
export TEST=0 for size in `echo ls directory_name | lftp -u user,pass ftpserver | awk '{ print $5 }'` ; do export TEST=$1) ; done echo $TEST In the above script - note the special backtick used. i.e. ` <br> awk '{ print $5 }' //prints out the 5th column <br> Note - the total size added up is in bytes. In order to calculate KB - divide by 1024, and for MB - divide again by 1024 and for GB - divide again by 1024. <br> The above may work with ftp (rather than lftp) but I had lftp installed.
1)
$size + $TEST
ftp.txt · Last modified: 2022/07/19 21:13 by 127.0.0.1