Skip to content

Instantly share code, notes, and snippets.

@tmuth
Created August 5, 2014 13:10
Show Gist options
  • Save tmuth/7601e1744d35dc6da1c4 to your computer and use it in GitHub Desktop.
Save tmuth/7601e1744d35dc6da1c4 to your computer and use it in GitHub Desktop.
Scripted OSWatcher file collection - iostat, last 7 days
#/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