Project

General

Profile

Actions

Feature #34431

open

print largest attachements, sorted by size

Added by Han Boetes almost 4 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

I just got the dreaded 90% of the filesystem in use and spend some time creating a MySQL query that helps me find the largest attachments.

mysql> select attachments.container_id,attachments.filename,sys.format_bytes(attachments.filesize),users.login from attachments right join users on attachments.author_id=users.id where container_id is not NULL order by filesize desc limit 10;
+--------------+--------------------------------+----------------------------------------+------------------+
| container_id | filename                       | sys.format_bytes(attachments.filesize) | login            |
+--------------+--------------------------------+----------------------------------------+------------------+
|        20956 | VID_20191004_083624.mp4        | 704.22 MiB                             | user1            |
|        20956 | VID_20190710_145242.mp4        | 448.04 MiB                             | user1            |
|        17897 | CompleteMQTG_DGCA_20170226.pdf | 443.92 MiB                             | engineering      |
|        18162 | BoschRexroth_Manual.rar        | 406.22 MiB                             | user2            |
|        14327 | ADU indication issue.mp4       | 389.63 MiB                             | engineering      |
|        13816 | Engine no 2 Flame out.mp4      | 382.81 MiB                             | engineering      |
|        13816 | Engine 1 Flame out.mp4         | 379.76 MiB                             | engineering      |
|        24115 | 20200611_004044.mp4            | 374.91 MiB                             | user2            |
|        18287 | Run System Check.MOV           | 373.93 MiB                             | user2            |
|        20956 | VID_20190625_140218.mp4        | 371.31 MiB                             | user1            |
+--------------+--------------------------------+----------------------------------------+------------------+

After which I could send out an email asking various users if those attachments are still needed.

Perhaps this might be useful to someone.


Files

1.jpg (24.3 KB) 1.jpg lin hui, 2020-12-11 07:07
Actions

Also available in: Atom PDF