Skip to content

Instantly share code, notes, and snippets.

@hfs
Created April 10, 2014 15:00
Show Gist options
  • Save hfs/10391365 to your computer and use it in GitHub Desktop.
Save hfs/10391365 to your computer and use it in GitHub Desktop.
Wrap a command with 'nice' and 'ionice' to give it lower CPU and IO priority
#!/bin/sh
#
# Start the command "$0.original", i.e. with the same name and ".original"
# appended with nice (lower CPU priority) and ionice (lower IO priority)
#
# Usage: If you want to provide "foo", rename "foo" to "foo.original", then
# link this script in "foo"'s place
nice ionice -c 3 "$0.original" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment