Log in

View Full Version : Prune Attachments by date


waddy
02-09-2002, 11:59 AM
I think a hack where you can remove Attachments older than a certain date would be very good...

Example : remove any attachments older than 4 weeks

Anyone want to have a go at this one or know a SQL statement so i can do it manually ?

Thanks

waddy
02-11-2002, 12:56 PM
I think this would be a very handy hack.......

But to achieve this through phpMyAdmin read below

Thanks to Pogo :

To remove old attachments:

To see them :
select * from attachment where dateline < UNIX_TIMESTAMP('yyyy-mm-dd hh:mm:ss')

To delete them:
Delete from attachment where dateline < UNIX_TIMESTAMP('yyyy-mm-dd hh:mm:ss')

i.e

Delete from attachment where dateline < UNIX_TIMESTAMP('2002-01-20 02:00:00')

Removed all the attachments posted before 20th of Jan 2002

I shaved a nice 45MB of my Database using this.

Mystics
02-26-2003, 03:23 PM
*eXtreme old bumping* :D

Use this (very old) Hack:
https://vborg.vbsupport.ru/showthread.php?threadid=23692