Skip to main content
Topic: Scheduled: Delete Topics (Read 918 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Scheduled: Delete Topics

I hope this is a feature already, and I just can't find it..

I have a "Practice Board" where users can go "mess around", learning how to do stuff in the forum.
I'd like to set a scheduled task so that everything (but pinned posts) in that board are removed/deleted 24-48* hours after they are posted. If a topic has a pinned post in it, then, of course, the topic isn't removed, just the unpinned posts older than a day.

*e.g. runs once a day - anything older than 24 hours is scrubbed - or recycled.



If this isn't a feature already, and this query gets moved to Feature Discussion, then I'll add that, ideally, I could select the boards/topics this scheduled task would apply to, and even better, the delay time - 1, 2, 3, ... days -  for each selected board/topic.

// Deep inside every dilemma lies a solution that involves explosives //

Re: Scheduled: Delete Topics

Reply #1

I don't believe there is a scheduled maintenance task like that.  There is a manual maintenance task to remove old posts, old being those that have not been active in X days.  Anyway I don't think it would be that difficult a task to have added as one should be able to leverage that existing manual task somewhat. 

In some ways it would be easier to create the forum as you like and dump the sql as a backup .. then using a cron task that runs every 2 days simply restore that dump as the new database.

Re: Scheduled: Delete Topics

Reply #2

Quote from: Spuds – I don't believe there is a scheduled maintenance task like that.  There is a manual maintenance task to remove old posts, old being those that have not been active in X days.  Anyway I don't think it would be that difficult a task to have added as one should be able to leverage that existing manual task somewhat. 

I saw that manual task, and at first I thought it was what I was looking for.  So close...

Quote from: Spuds –
In some ways it would be easier to create the forum as you like and dump the sql as a backup .. then using a cron task that runs every 2 days simply restore that dump as the new database.

HA! Just dump the db and simply restore the backup....  I love it. (Seriously, what could go wrong?)

About 20 years ago I quipped to a friend of mine as we were alpha testing a program that had descended into the twilight zone - "Never give a C+ programmer fissionable material - they know no fear..." :-)

I'm a retired hardware engineer, let me tell you about the time I stunk up the V&V lab with loud smoke and smelly fire, and set the development program back 6 months... ("It wasn't supposed to do that", he said. "The spec sheet said it could handle that", he said..)  Yea, well, it didn't this time.

I'll give it some thought, Spuds... (indeed I will, my signature not withstanding), but I tend to think of sql back-ups and restores as recovery activities, not "maintenance".

Meanwhile, if someone wants to add that as a scheduled task to a future release, I'll return the db restore activity to recovery, in case the task goes awry..

Thanks!
Last Edit: October 27, 2020, 03:13:20 am by Steeley

// Deep inside every dilemma lies a solution that involves explosives //

Re: Scheduled: Delete Topics

Reply #3

I did an SMF mod that wouldn't take long to adapt to ElkArte that did this - it was ostensibly 'delete old topics' but you could set the age by board, so you could set all the other boards to never delete, then 2 days on the one board.

It's been ages since I looked at packaging an ElkArte mod but I can't imagine it would be very different. I attached the SMF version to this post in case anyone wants to give it a go. Licence-wise it's CC0 or public domain or whatever you want to call it - feel free to adapt it as you see fit.

Re: Scheduled: Delete Topics

Reply #4

-=tagged=-

If someone does give this a go for ElkArte, please ping me!

(As Johann Sebastian Schwarzenegger quipped: "I'll be Bach")

Last Edit: November 21, 2020, 04:34:39 pm by Steeley

// Deep inside every dilemma lies a solution that involves explosives //