In friendica, I can set my posts to expire after a given number of days.
This destroys the evidence, keeps the db from expanding infinitely, or serves other purposes.
So, I was thinking of how to make statusnet do the same thing.
I think I have a script that will delete posts 3 months old or older, and I believe I can have cron fire it off with whatever desired frequency (weekly, monthly, whatever).
#!/bin/bash
# script to expire status.net posts older than 3 months old
# by tony baldwin | www.tonybaldwin.me
# released according to GPL v. 3
datenow=$(date +%Y%m%d)
datemin3=$(date -d "$datenow - 3 months" "+%Y%m%d")
query="DELETE FROM `notice` WHERE `created` <= '$datemin3 01:01:01'"
# edit the $PASSWORD to reflect your password
# and $DBNAME to reflect your db's name
/usr/bin/mysql -D $DBNAME -u root -password="$PASSWORD" << eof
$query
exit
Pretty simple, really, but I haven't tested it.
What do you think?
Comments
Having said all of that, your script sounds like a good first step along that road.
It now also expires replies and conversations, in addition to notices.
I have cron fire it off a couple times/month.