-1

I have a bash script that I execute using cron. The script begins like this:

#! /bin/bash

DIR=/home/pi/bin/run

renice 19 -p $$
ionice -c 3 -p $$
:

Now, every time cron runs this script it sends me a mail:

/home/pi/bin/run/test-script:
6461 (process ID) old priority 0, new priority 19

When I comment out the renice command the script executes without a problem.

I don't want cron to send me a mail that the script reniced itself because that's by design.

What's going on and/or how can I fix this?

6
  • What happens if you start the script directly in the shell? May 31, 2014 at 15:31
  • That's interesting: $ ./00-test-script .... 9395 (process ID) old priority 0, new priority 19 ..... The script outputs the line...
    – Mausy5043
    May 31, 2014 at 15:37
  • But there is no line 31: i: command not found error message? May 31, 2014 at 15:41
  • Can you just include the whole script. There's more there that would seem to be the issue than what you're showing us here.
    – slm
    May 31, 2014 at 18:16
  • I edited the question because there appeared to be two different causes.
    – Mausy5043
    Jun 1, 2014 at 6:55

1 Answer 1

-1

Try using these forms of renice and ionice:

$ renice 19 -p $$ >/dev/null 2>&1
$ ionice -c3 -p $$ >/dev/null 2>&1
1
  • Yes, that does the trick.
    – Mausy5043
    Jun 1, 2014 at 6:55

Not the answer you're looking for? Browse other questions tagged .