[Friendica] Worker cron job

Hello :slight_smile: I noticed that when I made a new post on my new Friendica instance, the worker in the background was very slow to run the notifier task (I assume this is to do with how it spreads messages through the various protocols to different servers on the Fediverse).
I found this was run by a cron job, and doing the below seems to have solved the issue.
I wanted to write it up here in case anyone else runs into the same issue.

# Use Yunohost's shell to travel to /var/www/friendica,
# Friendica's app directory, as `sudo cd` is disabled.
$ sudo yunohost app shell friendica

# Once the shell has loaded, `cd` into the directory,
# open the latest php and run worker.php
$ cd /var/www/friendica; /usr/bin/php  bin/worker.php

# Make a new crontab file. This is saved as a temp file
# in /tmp but is also copied to /var/spool/cron/crontabs
# and /etc/cron.d/
$ crontab -e

# Select your text editor of choice (I like nano), and then
# add at the bottom of the file:
*/10 * * * * /var/www/friendica; /usr/bin/php bin/worker.php

Then save with CTRL+O and exit with CTRL+X.
According to these instructions, this will make the worker run at most every 10 minutes.

Here is an explanation of how a crontab file is structured (what all those asterisks mean).

Before, the notifier tasks were going every 30-45 minutes. Now they go every ~5 minutes. :slight_smile:

1 Like


i implemented the deamon instead of the cron for the package: Daemon by OniriCorpe ยท Pull Request #127 ยท YunoHost-Apps/friendica_ynh ยท GitHub

could you test it, once the automated tests are fine (all green!)?