Report this

What is the reason for this report?

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

Posted on June 13, 2015

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 ?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

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

MAILTO="email@address.com"
00 18 * * * quota -u johndoe > /home/johndoe/userquota.txt 

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.