Administration
Background tasks

Configuring Cron for Linux

9min

The Cron job scheduler is a component of the Linux operating system. It is used to run certain scripts on a server at the right time, according to a schedule.

Starting with version 5.1.0 there is a special script which is responsible for running the background tasks:

Shell


It can be executed manually or set to run on the Cron scheduler.

We recommend that you first test the script in manual mode. To do this, run the script

Shell


Check the file/var/www/app/logs/run-command.log for errors

💡 Your user must have write access to the folder logs

Setting up Cron

Let's set up a launchrun-scheduled-tasks.php for every minute.

Open the Cron settings file

Shell


Add a line

Shell


Save the file.

Testing out and troubleshooting

Go to Passwork under the administrator and open the Background tasks page.

If configured correctly, you will see a message that the scheduler is configured.

Document image


If you see a message that the scheduler is not configured, runtime errors can be found in the log file/var/www/app/logs/run-command.log. It can be sent to Passwork Technical Support for details.

Setting up a script to run as another user

By default, cron runs scripts as a userroot. You can set up another user with more limited privileges to increase security measures.

First, log in as a required useruser:

Shell


Run the script to make sure that the nameuser everything works correctly.

Shell


Check that you haveuser have write rights to

Shell


If the script worked without errors, set up a cron for the useruser

Shell


Add a line

Shell


And save the file.

Cron logs

To view the crone log, use the command

Shell