Configuring Cron for Linux
💡 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:
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
The script will display the information on the screen and write it to its log file:
💡 Make sure that the user on whose behalf you run the script has write permissions to the logs folder
In this example we will show how to configure Cron to run a script every 20 minutes.
Open Cron's configuration file
Add the line:
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
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:
Run the script to make sure that everything works correctly as user.
Make sure that user has write permissions to
If the script worked without errors, set up a cron for the user ``user
Add the line
And save the file.
You can check the cron log by using the command