1

I have a shell script which will run project consist of multiple JUnit tests.

Then I call this shell within cron job every a period of time. In this case, I observe the following:

  • Time to complete executing this shell is longer than directly calling this shell.

I don't know why!?

They must have the same run time, mustn't they?

H.H
  • 189
  • 1
  • 8

1 Answers1

0

Your cron job is receiving less resources, you can run it with a higher priority with:

/usr/bin/nice --adjustment=-10 /path/to/cron-script

Note the command above will reduce the resources of running services, so be careful using in production services.

Willian Paixao
  • 2,691
  • 3
  • 18
  • 33