Created
August 5, 2014 13:10
-
-
Save tmuth/7601e1744d35dc6da1c4 to your computer and use it in GitHub Desktop.
Scripted OSWatcher file collection - iostat, last 7 days
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/bash | |
file_name="" | |
if [ $# -gt 0 ] | |
then | |
file_name="_$1" | |
fi | |
while read line; do | |
(ssh -n -q root@$line 'find /opt/oracle.oswatcher/osw/archive \ | |
\( -name "*iostat*.*" \) -mtime -7 \ | |
-prune -print0 2>/dev/null | \ | |
xargs -0 tar --no-recursion -czf - 2>/dev/null ' | cat > osw${file_name}_${line}.tar.gz | |
) | |
done < /home/oracle/tyler/osw/cells |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment