Jump to content

Wondering about crontab parameter


qeldroma
 Share

Recommended Posts

01 * * * * root nice -n 19 run-parts /blabla

 

I did not find any explanations to the part

 root nice -n 19 run-parts

.

 

What's that for?

 

"root" is the user it runs under?

"nice" tells him to wait till cpu is idle?

"-n 19" A nice parameter?

"run-parts" ...?

 

No manual entry for that, info either.

Link to comment
Share on other sites

I got the following from MUB:Arusabal:

01 * * * * root nice -n 19 run-parts /blabla

 

I did not find any explanations to the part

 root nice -n 19 run-parts

.

 

What's that for?

 

"root" is the user it runs under?

Yes

"nice" tells him to wait till cpu is idle?

"-n 19" A nice parameter?

the nice command sets the priority of a task, from -20 to +20. The higher is the number the lower is the priority of that command. So "nice -n 19" (or nice 19) is telling the kernel to execute "cron-parts" at a very low priority. Since it is a background task it is a good idea to set a low priority in order to don't disturb "foreground" jobs that might be executing at the same time.

see "man nice"

"run-parts" ...?

 

No manual entry for that, info either.

It's a command to execute all the scripts that are within a directory. For example it is used to run all the scripts within /etc/cron.hourly. Check its man page (man "run-parts")

 

Conlcusion:

That crontab's line ("01 * * * * root nice -n 19 run-parts /blabla is telling cron to run every single hour (the first minute of each hour) all the scripts located in /blabla at a very low priority.

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...