LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-11-2005, 07:22 PM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
Nice vs Priority, how do I prioritise a cronjob?


I'm somewhat confused in regards to nice vs priority.

I sometimes renice a job in order to run it faster like a bzip.

But looking in top it certainly has given it a different nice value but it hasn't made any difference to the priority or somtimes it seems to change the priority with one digit only.

My intention is to actually speed up our backups, they run during the night but take way too long to complete thus givein people problem in the mornings.

It wouldn't be an issue to run them at higher priority in the middle of the night at the expenses of other services, I rather have this then running them late.

Do I renice the job? Can I increase the priority, and more so can I do this on a cronjob?

Thx
 
Old 08-11-2005, 07:31 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Just use "nice -nADJUSTMENT COMMAND". Man nice.
 
Old 08-11-2005, 07:46 PM   #3
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
This is my current job:

/root/.scripts/backuppsa.sh >>/dev/null 2>&1

so do I go "nice -20 /root/.scripts/backuppsa.sh >>/dev/null 2>&1"

in my cronjob ?
 
Old 08-11-2005, 07:56 PM   #4
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Exactly.
 
Old 08-11-2005, 08:03 PM   #5
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
A follow up question that though that just came to mind.

This backup script is full of tar and gzip commands.

So if I were to nice the script will these internal jobs in the script actually run at that nice level.

Or should I actualy edit all these jobs in the script entering all their nice values seperately?
 
Old 08-11-2005, 08:17 PM   #6
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
As I understand, the base priority for children will be equal to the priority of the parent. In other words, just nicing the script should work. A brief test showed this to be the behavior on my system.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Priority of processes (using nice) started from within a script podollb Linux - Software 1 01-08-2006 11:44 AM
'nice' priority is working backwards! wapcaplet Linux - Software 5 11-19-2004 09:46 AM
prioritise packets with cbq.init for better ping times kilgor Linux - Networking 1 05-28-2004 11:20 AM
Scheduling priority for the 'nice' command savoiu Linux - Newbie 2 05-18-2004 11:35 AM
Nice and confused about nice Hangdog42 Linux - General 5 06-03-2003 04:44 PM


All times are GMT -5. The time now is 10:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration