Solved

npri not on SunOS - is there an acceptable substitute

Posted on 2004-09-08
4
308 Views
Last Modified: 2010-04-21
I am running a cron job to remove log files that reach a certain size.  On the IRIX OS, this is no problem.  However, the command I'm using (npri) doesn't exist on the SUNs.  What can I use instead?
0
Comment
Question by:ambulance
4 Comments
 
LVL 20

Expert Comment

by:tfewster
ID: 12007483
`npri` is used to set the priority of a process; The equivalent command under Solaris would be `nice` or `renice`
0
 

Author Comment

by:ambulance
ID: 12007567
Could I use it the same way?

The 5 columns, nice find /mnt/project_out/.....*.log -size 9765 -exec rm {} \; &

0
 
LVL 18

Accepted Solution

by:
liddler earned 125 total points
ID: 12007768
Yes, that should work, you can specify how nice (1-19) you want to lower the priority of the job by
nice -n 19 ...
to make it really low priority, the default is 10
0
 
LVL 62

Expert Comment

by:gheist
ID: 12016211
Equivalent command is called priocntl ( defeating process aging, setting fixed high or low "pri" value etc) , but "nice" is posix utility and suits your application perfectly.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question