|
|
Pause and resume resource-intensive apps via script
Replying to my own hint here.
it looks like the editor accidentally chopped off the three command line args from the hint. so the three numbers I referred to in the hint were supposed to follow that one line perl script.
A couple notes about that script. The script is polite in that if you break out of it with control-C, it will leave your app in a running state, not suspended. Additionally, if your application quits then the script eventually notices this and terminates itself, thus you can set this to run in the background if you want. It won't bother the script if, in another window you suspend or continue the application, so you still can have some fine grained manual control if you need it. And you can run as many copies of this as you wish to control other applications. Nothing dire will happen if you mistakenly run this twice to control the same job, thought that's not the reccomended use. Now as for converting this into an alias to make it handy to use, here is a version of it I have escaped all the special characters to allow you to do this easily. Cut and paste the following verbatim into a terminal window--you should do this as one single cut and paste not a line at a time. finish with a carriage return from the keyboard.
To use this after installing that alias you would type at the command line
where 3357 is the name of whatever process you want to supernice, and 3.0 is the upper load limit trip where you want it to stop, and 0.5 is the lower load limit trip where you will let it resume after being stopped. Fill in your own numbers as appropriate.
Output from the script will display the number of seconds the job has been stopped and how long it has been running since supernice was invoked. It also displays the load levels for the last 1 minute and last ten minutes. These numbers update every 30seconds when in CONT mode or 5 minutes in STOP mode. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.49 seconds |
|