Created
November 8, 2018 10:24
-
-
Save ginokent/c3ca3eaefdb31cca5a9a4fe5ba887c2b to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
getps() { | |
/usr/bin/ionice -c 3 /usr/bin/nice -n 19 /bin/bash -c '{ | |
TODAYLOG="$HOME/getps_$(/bin/date +%Y%m%d).log" | |
YESTERDAYLOG="$HOME/getps_$(/bin/date -d yesterday +%Y%m%d).log" | |
{ | |
/bin/echo "==> delimiter <=="; | |
/bin/date -Is; | |
/bin/ps auxfewww; | |
/bin/echo; | |
} >>"${TODAYLOG}" 2>&1; | |
if [ -f "${YESTERDAYLOG}" ] && [ -r "${YESTERDAYLOG}" ]; then gzip "${YESTERDAYLOG}"; fi; | |
}' | |
} | |
getps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment