Skip to content

Commit f6a6d3b

Browse files
authored
Merge pull request #15435 from nextcloud/backport/15423/stable34
[stable34] docs(user): clarify deleted files and storage quotas
2 parents c45ae69 + 7d2ac13 commit f6a6d3b

2 files changed

Lines changed: 154 additions & 71 deletions

File tree

Lines changed: 117 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,127 @@
1-
======================
2-
Managing deleted files
3-
======================
1+
=============
2+
Deleted files
3+
=============
44

5-
When you delete a file in Nextcloud, it is not immediately deleted permanently,
6-
only moved into the trash bin. It is not permanently deleted until you manually
7-
delete it, or when the Deleted Files app deletes it to make room for new files.
5+
When you delete a file or folder in Nextcloud, it is normally moved to the
6+
trash bin instead of being deleted immediately. This allows you to restore it
7+
later.
88

9-
Find your deleted files by clicking the **Deleted files** button on the Files
10-
page of the Nextcloud web interface. You can restore or permanently delete files from there.
9+
Items in the trash bin are permanently deleted when one of the following
10+
occurs:
11+
12+
- You manually select *Delete permanently*.
13+
- The Deleted Files app removes the item according to the configured retention
14+
policy.
15+
- The effective trash-bin size limit is exceeded and the item is eligible for
16+
removal to free space.
17+
18+
Find your deleted files by selecting **Deleted files** in the Files area of the
19+
Nextcloud Web interface. From there, you can restore items, download them to
20+
your device, or delete them permanently.
21+
22+
When you restore an item, Nextcloud normally attempts to return it to its
23+
original location. If that location no longer exists or is not writable, the
24+
item is restored to the root of your Files area. If an item with the same name
25+
already exists, Nextcloud gives the restored item a unique name.
26+
27+
.. note:: If the Versions app is enabled, versions associated with a deleted
28+
file are moved to the trash bin and are restored when the file is restored.
1129

1230
Quotas
1331
------
1432

15-
Deleted files are not counted against your storage quota. Only your personal
16-
files count against your quota, not files which were shared with you.
17-
(See :doc:`quota` to learn more about quotas.)
33+
Files and folders in your trash bin do not count against your normal storage
34+
quota.
35+
36+
See :doc:`quota` for more information about how storage quotas are calculated.
1837

1938
What happens when shared files are deleted
2039
------------------------------------------
2140

22-
Deleting files gets a little complicated when they are shared files, as this
23-
scenario illustrates:
24-
25-
1. User1 shares a folder "test" with User2 and User3
26-
2. User2 (the recipient) deletes a file/folder "sub" inside of "test"
27-
3. The folder "sub" will be moved to the trash bin of both User1 (owner) and
28-
User2 (recipient)
29-
4. But User3 will not have a copy of "sub" in their trash bin
30-
31-
When User1 deletes "sub" then it is moved to User1's trash bin. It is
32-
deleted from User2 and User3, but not placed in their trash bins.
33-
34-
When you share files, other users may copy, rename, move, and share them with
35-
other people, just as they can for any computer files; Nextcloud does not have
36-
magic powers to prevent this.
37-
38-
How the deleted files app manages storage space
39-
-----------------------------------------------
40-
41-
To ensure that users do not run over their storage quotas, the Deleted Files
42-
app allocates a maximum of 50% of their currently available free space to
43-
deleted files. If your deleted files exceed this limit, Nextcloud deletes the
44-
oldest files (files with the oldest timestamps from when they were deleted)
45-
until it meets the memory usage limit again.
46-
47-
Nextcloud checks the age of deleted files every time new files are added to the
48-
deleted files. By default, deleted files stay in the trash bin for 30 days. The
49-
Nextcloud server administrator can adjust this value in the ``config.php`` file
50-
by setting the ``trashbin_retention_obligation`` value. Files older than the
51-
``trashbin_retention_obligation`` value will be deleted permanently.
52-
Additionally, Nextcloud calculates the maximum available space every time a new
53-
file is added. If the deleted files exceed the new maximum allowed space
54-
Nextcloud will permanently delete those trashed files with the soonest expiration
55-
until the space limit is met again.
56-
57-
.. note:: Your administrator may have configured the trash bin retention period
58-
to override the storage space management. See `admin documentation <https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin>`_ for more details.
41+
The behavior of deleted shared files depends on who deletes the item and who
42+
owns it.
43+
44+
For example, User1 shares a folder named ``TheProject/`` with User2 and User3:
45+
46+
1. User2, a share recipient (sharee), deletes a folder or file named
47+
``Phase2`` inside ``TheProject/``.
48+
49+
``TheProject/Phase2`` is moved to the trash bin of User1, the owner, and a
50+
copy is placed in User2's trash bin when possible. The item is removed from
51+
the shared folder for User3, but User3 does not receive a copy in their
52+
trash bin.
53+
54+
2. User1, the owner, deletes ``TheProject/Phase2``.
55+
56+
The item is moved to User1's trash bin and removed from the shared folder for
57+
User2 and User3. It is not placed in their trash bins.
58+
59+
The exact behavior can depend on the type of share and the permissions granted
60+
by the share. Depending on those permissions, other users may be able to copy,
61+
rename, move, or re-share shared files. These operations can affect which
62+
account owns the resulting files and which trash bin receives a deleted item.
63+
64+
.. note::
65+
66+
When a sharee deletes an item owned by another user, Nextcloud moves the item
67+
to the owner's trash bin. A copy in the deleting user's trash bin is also
68+
created (in most cases; the copy is on a best-effort basis and is not
69+
guaranteed).
70+
71+
How the Deleted Files app manages storage space
72+
------------------------------------------------
73+
74+
The Deleted Files app manages trash-bin contents using two related rules:
75+
76+
- A storage limit determines how much space the trash bin may use.
77+
- A retention policy determines when deleted items become eligible for
78+
permanent deletion.
79+
80+
Trash-bin storage limit
81+
~~~~~~~~~~~~~~~~~~~~~~~
82+
83+
For accounts with a storage quota, the default trash-bin limit is up to 50% of
84+
the account's remaining quota space. This is calculated after the account's
85+
active files have been taken into account; it is not 50% of the account's total
86+
quota.
87+
88+
For example, if your quota is 10 GB and your active files use 8 GB, the default
89+
trash-bin allowance is calculated from the remaining 2 GB.
90+
91+
For accounts without a storage quota, the default limit is calculated using
92+
available filesystem space instead. Your administrator can override either
93+
default by configuring a global or per-account trash-bin size.
94+
95+
When the effective trash-bin limit is exceeded, Nextcloud removes eligible
96+
deleted items, starting with the oldest items, until the limit is satisfied
97+
again.
98+
99+
Retention and permanent deletion
100+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101+
102+
By default, deleted files are retained for at least 30 days. After that,
103+
eligible items may be permanently deleted when space is needed; they are not
104+
necessarily deleted immediately after 30 days.
105+
106+
Your administrator can configure different minimum and maximum retention
107+
periods. Depending on the configuration, items may be permanently deleted
108+
after a maximum age even when storage space is not currently needed. Automatic
109+
expiration can also be disabled.
110+
111+
For policies with a configured minimum retention period, an item is eligible
112+
for space-based cleanup only after that period has elapsed. Policies without a
113+
minimum retention period may allow space-based cleanup regardless of the
114+
item's age. Items that have exceeded a configured maximum retention period can
115+
be permanently deleted regardless of whether space is currently needed.
116+
117+
The relevant configuration setting is
118+
``trashbin_retention_obligation``. For details about the available values and
119+
their interaction with quotas and trash-bin sizes, see the
120+
`Deleted Files section of the Administrator Manual
121+
<https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/trashbin_configuration.html>`_.
122+
123+
.. note::
124+
125+
The Deleted Files app may permanently delete an item before its maximum
126+
retention period when the effective trash-bin limit is exceeded and the
127+
item's minimum retention period has elapsed.

user_manual/files/quota.rst

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,52 @@
22
Storage quota
33
=============
44

5-
Your Nextcloud administrator has the option to set a storage quota on users. Look at
6-
your Personal page to see what your quota is, and how much you have used.
5+
Your Nextcloud administrator can set a storage quota for your account. Open
6+
your Personal settings page to see your quota and how much storage you have
7+
used.
78

89
.. figure:: ../images/quota1.png
910
:alt: Storage quota indicator on the Personal page
1011

1112
It may be helpful to understand how your quota is calculated.
1213

13-
Metadata (thumbnails, temporary files, cache, and encryption keys) takes up
14-
about 10% of disk space, but is not counted against user quotas. Some apps
15-
store information in the database, such as the Calendar and Contacts apps. This
16-
data is excluded from your quota.
14+
Metadata such as thumbnails, temporary files, caches, and encryption keys can
15+
use disk space without counting against your user quota. Some apps store data
16+
in the database, such as the Calendar and Contacts apps. This data is not
17+
included in the file-storage quota.
1718

18-
When other users share files with you, the shared files count against the
19-
original share owner's quota. When you share a folder and allow other users or
20-
groups to upload files to it, all uploaded and edited files count against your
21-
quota. When you re-share files shared with you, the re-share still counts
22-
against the quota of the original share owner.
19+
When other users share files with you, the shared files normally count against
20+
the original owner's quota. When you share a folder and allow other users or
21+
groups to upload or edit files in it, those files count against your quota.
22+
When you re-share files shared with you, the re-share normally continues to
23+
count against the original owner's quota.
2324

24-
Encrypted files are a little larger than unencrypted files; the unencrypted size
25-
is calculated against your quota.
25+
Encrypted files can use more physical storage than unencrypted files. The
26+
quota calculation uses the file size reported by Nextcloud's storage layer.
2627

27-
Deleted files that are still in the trash bin do not count against quotas. The
28-
trash bin is set at 50% of quota. Deleted file aging is set at 30 days. When
29-
deleted files exceed 50% of quota then the oldest files are removed until the
30-
total is below 50%.
28+
When the Versions app is enabled, older file versions are managed separately
29+
from the normal storage quota according to the app's retention and storage
30+
rules.
3131

32-
.. note:: Your administrator may have configured the trash bin retention period
33-
to override the storage space management. See `administrator documentation <https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin>`_ for more details.
32+
If you create a public share through a URL and allow uploads, uploaded files
33+
count against your quota.
3434

35-
When version control is enabled, the older file versions are not counted against
36-
quotas.
35+
Deleted files and the trash bin
36+
-------------------------------
3737

38-
If you create a public share via URL and allow uploads, any uploaded files
39-
count against your quota.
38+
Files and folders in your trash bin do not count against your normal storage
39+
quota. The trash bin nevertheless has its own storage limit.
40+
41+
For accounts with a quota, the default amount of space available to the trash
42+
bin is calculated as 50% of the account's remaining quota space. This is
43+
calculated after the account's active files have been taken into account; it is
44+
not 50% of the total quota.
45+
46+
For accounts without a quota, the default trash-bin limit is calculated using
47+
available filesystem space instead. An administrator can configure a global or
48+
per-account trash-bin size that overrides the calculated default.
49+
50+
Your administrator can also configure minimum and maximum trash-bin retention
51+
periods, or disable automatic expiration. See the `Deleted Files section of the Administrator Manual
52+
<https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/trashbin_configuration.html>`_
53+
for details.

0 commit comments

Comments
 (0)