井水玉藻
切换到 www-data 用户(php,nginx用户)并编辑其 crontab:
# 使用 root 权限执行此命令来编辑 www-data 的定时任务
crontab -u www-data -e
sudo apt-get update && sudo apt-get install cron
In case you are using a RHEL based Linux distribution (CentOS, AlmaLinux, Rocky Linux...), install cron like this:
sudo dnf update && sudo dnf install crontabs
Once you have cron installed, let's create the one and only entry you need for Flarum:
crontab -e
This will open the cron editor. You may or may not have other entries there. Add this line, and remember to leave an empty line at the bottom.
* * * * * cd /path-to-your-project && php flarum schedule:run >> /dev/null 2>&1