Created
May 16, 2017 20:34
-
-
Save bradcordeiro/ddb755befd1206c3454815b2c46ad981 to your computer and use it in GitHub Desktop.
Print file information from LTFS index schema to CSV format using xmlstarlet
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
VOLUME_UUID=$(xmlstarlet sel -t -m "/ltfsindex" -v volumeuuid "${1}") | |
VOLUME_NAME=$(xmlstarlet sel -t -m "/ltfsindex" -v directory[1]/name "${1}") | |
xmlstarlet sel -t -m ".//file" \ | |
-o "${VOLUME_UUID}" -o "," \ | |
-o "${VOLUME_NAME}" -o "," \ | |
-v "extentinfo/extent[1]/startblock" -o "," \ | |
-v name -o "," \ | |
-v "length" -o "," \ | |
-m "ancestor-or-self::directory" -v "name" -o "/" -b -o "," \ | |
-v readonly -o "," \ | |
-v creationtime -o "," \ | |
-v changetime -o "," \ | |
-v modifytime -o "," \ | |
-v accesstime \ | |
-n "${1}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment