Feature #34431

print largest attachements, sorted by size

Added by Han Boetes about 1 month ago. Updated about 1 month ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:-
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.

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

History

#1 Updated by lin hui about 1 month ago

#2 Updated by Go MAEDA about 1 month ago

  • Category set to Attachments

Also available in: Atom PDF