How to run scripts in cron?

Version 2023.02.07 released a script named dspacerestprocess, which has been introduced, in order to run DSpace processes from CLI directly as they were requested from the UI.

In order to use the dspacerestprocess property, it should be set in the local.cfg with a machine token: dspace.cli.jwt =

To use the machine token it is important to have configured the property

jwt.login.token.secret = <some random generated complex string>

in the local.cfg.

This property must be set and tomcat restarted before that the machine token can be generated otherwise this token will became invalid as soon as tomcat is restarted

Please note that the dspacerestprocess script requires a slightly different format for the argument to pass to the script

Test if scripts in cron work

Example: if you want to run the index-discovery task from the command line, you have to run the following command:

./dspacerestprocess index-discovery -b=

Please note the = after the -b that is required due to the differences in dealing with parameters, explained in the previous paragraph