Created
August 3, 2019 20:37
-
-
Save iamshreeram/4e48f6675c73f294e898b510f5588434 to your computer and use it in GitHub Desktop.
Help purging files from directory
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 | |
| mondir="/app/log/" | |
| pid=`ps -eaf | grep 'java'| grep -v grep | awk -F' ' '{print $2}'` | |
| echo $(date -d '2 hour ago' "+%m%d%H%M%S") | |
| BUF_DATE=`expr $(date -d '2 hour ago' "+%m%d%H%M%S")` | |
| BUF_DATE="${BUF_DATE:0:6}" | |
| rm $mondir/jcmdr.$pid.$BUF_DATE* 2>/dev/null | |
| rm $mondir/top.$pid.$BUF_DATE* 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment