Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

How to run scripts in cron?

...

As of 2023.02.07 release a script named dspacerestprocess as been introduced, in order to run DSpace processes from CLI directly as they were requested from the UI.

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

Info

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

  • normal parameters must be passed in the form -<key>=<value>, this include the case where the parameter doesn’t have any value (i.e. if you need to pass the option -b without any value you need to put -b=

  • a file parameter, if you need to provide a file as an input of the script make sure to have a -f=<file-name> parameter and a --file <path-to-the-file-on-the-server>

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:

Code Block
./dspacerestprocess index-discovery -b=

...