-
-
Save lavoiesl/4381677 to your computer and use it in GitHub Desktop.
Run a script with lowest priority
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
date=$(date '+%s') | |
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