Skip to main content
Version: 7.0

Setting up Cron for Linux

The Cron job scheduler is one of the components of the Linux operating system. It is used to run certain scripts on a schedule.

Passwork version 7 and above has a special script responsible for running background tasks:

php ./bin/console tasks:run

It can be run manually or configured to run via the Cron scheduler.

We recommend first checking the script operation manually. To do this, execute:

sudo -u www-data bash -c 'cd /var/www && php ./bin/console tasks:run'

Check the /var/www/files/logs/tasks/ folder for errors.

info

The user must have write permissions to the log folder

Setting up Cron

Configure it to run every minute:

  • Open the Crontab settings for the web server user:
crontab -e -u www-data
  • Add the following line and save the changes:
* * * * * cd /var/www/ && php ./bin/console tasks:run

Checking and fixing errors

Open Passwork and log in as Administrator/Owner, then go to the Background Tasks tab.

If configured correctly, a message will be displayed indicating that the scheduler is set up:

Example of correct background tasks operation

If you see a message that the scheduler is not set up, then execution errors are located in /var/www/files/logs/tasks/