A partial archive of meta.discourse.org as of Tuesday July 18, 2017.

Cron rake task help

sedrickcz

I have old instance of Discourse and I created here three cron rake task, which handles automatic assignment to specific group, automatic import from my other site and update user titles if they change it on our website.

Is there any way how can I preserve this rake task after I update to new version of Discourse? I guess If I create them again, they will disappear after next update, right?

Thank you.

eviltrout

It depends how you have your updates set up. If the rake task is within your docker container you can expect it to be blown away on update.

We prefer using plugins for things like that, and check the plugins into git and have them checked out when the site is updated. Of course, you might also have some issues if internal APIs change that your rake task uses.

sam

We run cron inside our docker images, so you can use standard cron to fire it off, you would need to amend the template to place the cron configuration inside the container so it would be there after rebuild.

However, as @eviltrout said our scheduled job API is usually a far better fit and would give you better visibility into the job runs.

Muzammil_Ahmed

How can I build cron which fetch all users replies on topics with in 24 hours. And how to integrate into discourse dockerfile?