Skip to content

Instantly share code, notes, and snippets.

Created December 26, 2012 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4381662 to your computer and use it in GitHub Desktop.
Save anonymous/4381662 to your computer and use it in GitHub Desktop.
Run a script with lowest priority
#!/bin/sh
# $$ represents the current PID
# Set to lowest I/O priority
ionice -c idle -p $$
# Set to lowest CPU priority
renice -n -20 -p $$ >/dev/null
# Run a task
tar czf /mnt/backups/`date`.tar.gz /var/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment