Wednesday, June 20, 2012

Enabling Job Tasks

I decided to find a way to enable Job Tasks for MyImouto.

At first I thought of just adding scheduled events in MySQL, but then I realized Job Tasks run not only queries but also Ruby code.

I also realized that Danbooru uses a gem called Daemons that runs a RoR script (or something like this) somehow, and the Job Tasks are called.

I was able to do the same with MyImouto using Windows' Scheduled Tasks: It runs php.exe and tells it to run a php file, which starts the MyImouto system and then runs the job tasks! Just like in RoR.

It worked nicely, the job task deleted all my tags with count of 0. Amazing. lol.

One would have to setup the Scheduled Task on Windows to enable this. The task can be exported and imported and easily edited (it's an XML file) so it's not really a problem.

But most servers run Linux, so my question is: Does anyone know how to do setup scheduled tasks on Linux that will run PHP every certain hours?

Go to rest, you deserve it. I'll call you later.

2 comments: