Is there any ways to warn ftp user about his space disk quota ?

June 13, 2015 514 views
Email Monitoring Miscellaneous Ubuntu

Example case :
VPS UBuntu 14.04
Without UI Control Panel.
User johndoe
quota enabled
soft limit = 10000 (equal 9,785Mb)
hard limit = 10240 (equal to 10Mb)
johndoe already use 5Mb, so there is 5Mb remaining

Possibility #1
There are so many FTP app. out there, so let's limit to filezilla app.
When he starting to upload a file with size 6.5Mb with his filezilla, he will see warning message in his FTP message log for example
"WARNING : Your file size exceed your quota, Quota=10Mb, Used=5Mb"
and upload process failed prior to be started
Is this possible ?

Possibility #2
Create custom shell script to execute quotacheck daily (cron job) and add custom files into FTP user home directory.
e.g: remaining-spacedisk-5mb.quota OR quota.txt
So when he starting to connect with FTP app. he will see this file in his home directory and he will able to know his space disk quota.
is this possible ?

Possibility #3
Create custom shell script to execute quotacheck daily (cron job) and send space disk quota informations to FTP user via email.
is this possible ?

1 Answer


The first option is not possible as far as I'm aware, as this would be something that FileZilla, or the FTP client would have to implement. Altough, it would have to use something other than just FTP, as FTP doesn't really pass this sort of information. So I would rule possibility 1 out.

The other 2 are possible, but it would all depend on how you want to do it and your preference. I personally like option 2, as it doesn't require me to setup something to send mail.

If you are using user johndoe and assume their home directory is /home/johndoe, then the following cron would update daily at 6pm server time:

00 18 * * * quota -u johndoe > /home/johndoe/userquota.txt

If you did want to go option 3, then try this with a configured mail server already

00 18 * * * quota -u johndoe > /home/johndoe/userquota.txt 
Have another answer? Share your knowledge.