Legacy
...
Passwork 5
Mapping LDAP security groups w...

Configuring Cron for Linux

10min

💡 This is obsolete documentation for older versions of Passwork (before 5.1.0).

Starting from version 5.1.0 Passwork uses built-in background task mechanisms for LDAP synchronization.

The Cron 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.



Passwork has a special script that synchronizes users:

Shell


It can be run in manual mode or set to run in Cron scheduler. We recommend that you first test the script in manual mode. To do this, run the script

Shell


The script will display the information on the screen and write it to its log file:

Shell


💡 Make sure that the user on whose behalf you run the script has write permissions to the logs folder

Configuring Cron

In this example we will show how to configure Cron to run a script every 20 minutes.

Open Cron's configuration file

Shell


Add the line:

Shell


Save the file. Scheduler will run the script after 20 minutes, the result of its work can be seen in the log file.

💡 We recommend deleting the log file before running the cron for the first time

Configuring another user to run the script

By default cron runs scripts as root user. You can set it up to run as another user with more limited privileges for better security.

First, log in with the required user user:

Shell


Run the script to make sure that everything works correctly as user.

Shell


Make sure that user has write permissions to

Shell


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

Shell


Add the line

Shell


And save the file.

Cron logs

You can check the cron log by using the command

Shell