2

I often see this code in anacrontab samples on the internet:

# environment variables
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
RANDOM_DELAY=30
# Anacron jobs will start between 6am and 8am.
START_HOURS_RANGE=6-8
# delay will be 5 minutes + RANDOM_DELAY for cron.daily
1               5       cron.daily              nice run-parts /etc/cron.daily
7               0       cron.weekly             nice run-parts /etc/cron.weekly
@monthly        0       cron.monthly            nice run-parts /etc/cron.monthly

'nice" command as explained by "man nice" if for changing a program priority with a niceness parameter. However I do not understand the 'nice' command in the above sample if we do not add a niceness parameter.

1 Answers1

7

From the manual:

   -n, --adjustment=N
          add integer N to the niceness (default 10)

So, nice run-parts /etc/cron.daily is actually the same as any of the following:

nice -10 run-parts /etc/cron.daily
nice -n 10 run-parts /etc/cron.daily
nice -n +10 run-parts /etc/cron.daily
Ljm Dullaart
  • 2,788