Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save unicolet/5763403 to your computer and use it in GitHub Desktop.
Save unicolet/5763403 to your computer and use it in GitHub Desktop.
Script to archive all 'old format' drive information collected by opennms for Windows systems. Opennms > 1.10 will collect this data in a directory named after the drive letter (A,B,C, and so on) instead of the drive index.
/usr/bin/find /opt/opennms/share/rrd/snmp/ -wholename "*/hrStorageIndex/[12345]" -type d | /bin/tar -cf old_drive_info.tar --files-from -
/usr/bin/find /opt/opennms/share/rrd/snmp/ -wholename "*/hrStorageIndex/[12345]" -type d | /usr/bin/xargs /bin/rm -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment