Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /usr/share/doc/proftpd-doc/howto/ drwxr-xr-x |
Viewing file: Select action/file-type: ProFTPD: QuotasA busy FTP server handles hundreds to thousands of files belonging to hundreds to thousands of users. There is not an infinite capacity on the disks of the server, however, and eventually those files will take up too much space. Thus many sites have a pressing need to set limits on just how much can be stored on the server by their users.
Most Unix systems have support for OS- or fileystem-level quotas. These
have the advantage of being transparent to applications like
For these reasons, the Note: This howto is a work-in-progress. Please contact me with suggestions, questions, requests, etc for what you would like to see covered here. Thanks!
Example Configuration <IfModule mod_quotatab.c> QuotaEngine on QuotaLog /var/log/ftpd/quota.log # For more information on using files for storing the limit and tally # table quota data, please see the mod_quotatab_file documentation. <IfModule mod_quotatab_file.c> QuotaLimitTable file:/etc/ftpd/ftpquota.limittab QuotaTallyTable file:/etc/ftpd/ftpquota.tallytab </IfModule> # For more information on using a SQL database for storing the limit and # tally table quota data, please see the mod_quotatab_sql documentation <IfModule mod_quotatab_sql.c> SQLNamedQuery get-quota-limit SELECT "* FROM quotalimits WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery get-quota-tally SELECT "* FROM quotatallies WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" quotatallies SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies QuotaLock /var/lock/ftpd.quotatab.lock QuotaLimitTable sql:/get-quota-limit QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally </IfModule> </IfModule>
Question: How do I set the disk space limit for a user?
It's true that the various limits maintained by
Question: This question is also often posed as "Why can't mod_quotatab just calculate the amount of space used by a user?" The module could do this, but there are some considerations with this kind of approach.
The primary consideration is the time cost of having to recurse a directory.
If the directory is relatively small, the time needed is small. For very
large/deep directories, however, the time needed to do the scan could be
long, possibly long enough for users to notice and complain. Another
complication is the disk space used by a given user is not confined to
their home directory. Many sites have home directories for users, and
have a shared directory that all users can use. Somehow
As of
Question: If I use this <IfModule mod_quotatab.c> ... # Automatically calculate the used quota on login QuotaOptions ScanOnLogin # Do not include files ending in ".log" in the automatically # calculated quota QuotaExludeFilter \.log$ </IfModule>
Question: If
To help address this, there is a http://www.castaglia.org/proftpd/contrib/diskusewhich will display the number of bytes owned by a given user (or group) within a list of directories. The parameters needed for running diskuse.pl are documented
here.
Once you've run
Question: How can I set a default quota for all of my users?
Question: What is a "tally table"?
Question: How do I construct the limit and tally files for file-based quotas?
Question: Is there a SQL script for the SQL quota tables used by
Question: How do I set a limit on the size of a
directory?
Traditional Unix quotas are implemented in terms of ownership: the
thing that counts is not where a file is located on the filesystem, but
which user and/or group owns the file. Asking about directory quotas
assumes a different basis for quotas, based on location rather than
ownership (such quotas are often called tree-based quotas). The
Question: Why isn't
One possibility is that the per session flag in the limit in
effect is set to
Another possibility is that your configured limits are "unlimited" (i.e.
zero). As it states in the
For any quota limit that is set as "unlimited", mod_quotatab will not keep the tally.
Many site administrators might want this ability, for accounting purposes. However,
that ability is outside of the intended design of this module; other logging modules
are much better suited for accounting purposes (e.g. mod_sql's
If the above cases are not applicable, then consider looking in the
Question: Can I use
Question: How can users see their current quota?
Question: What if I want to set limits on the size of
individual files being transferred? Question: Why do I see the following error? QuotaLimitTable: unsupported table source type: 'sql'Answer: The mod_quotatab module acts
as a general quota managing front-end; it relies on other backend modules
to handle the specifics of storage formats. Every backend module
(e.g.
mod_quotatab_file , mod_quotatab_sql , mod_quotatab_ldap ) registers a supported table type with the main
mod_quotatab module. The error above indicates that the
mod_quotatab_sql module has not been compiled/loaded into
proftpd .
Question: How do group quotas work? If a user is in multiple groups, what happens?
mod_quotatab module does not combine multiple different
quotas.
What happens, then, if a user belongs to multiple different groups, and there
are different quotas set for those different groups? First, the primary
group of the user is checked; this is the group that is included, for example,
in the entry for the user in the
Question: Does
Question: I configured limits for my users such that
only the transfer bytes limit is set. On uploads, my transfer bytes tally
is incremented properly. But when I delete a file, the transfer bytes tally
is not decremented. Is this a bug?
Deleting a file does not count as transferred bytes (i.e. it does not
pertain to the
Question: Why does the
Answer: If you wish to prevent users from uploading
or downloading, then you should use
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]-- |