MyBB Community Forums

Full Version: Enable Systemd Timers to Handle MyBB Task System
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Create the following two files in your /etc/systemd/system/ directory:

Description=MyBB Tasks

ExecStart=/usr/bin/php /var/www/mybb/task.php

Description=Runs MyBB tasks every minute



Now, run the following commands in your terminal:
systemctl daemon-reload
systemctl enable mybb.timer
systemctl start mybb.timer
I am not familiar with systemd tasks, I want to know will it not require any admin authentication to run tasks ?
No authentication needed at all, the /task.php file is executed as the system user you specify in the mybb.service file (User=www-data).
don't forget to remove this from the footer template or adjust the comment so it comments out {$task_image} as well:

<!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE -->{$task_image}<!-- End task image code -->
This is working well. thanks, kawaii!
Nicely done, should probably explain why this may be preferred over MyBB's Crons Toungue
Bumping this to say that I finally got around to doing this and I should've done it long ago.

@kawaii is the best! Smile
We could use

php7.3 instead of PHP?
For those who have php7.3 running?
Description=MyBB Tasks

ExecStart=/usr/bin/php7.3 /var/www/mybb/task.php