Last active
May 9, 2018 21:13
-
-
Save bradcordeiro/6838722816193a9e3c415cc569c2072f to your computer and use it in GitHub Desktop.
Use xmlstarlet, bash sort, and awk to sort files from an LTFS schema by position on tape and write it to a text file suitable for rsync's --files-from
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
xml sel -t -m ".//file" -v "extentinfo/extent[1]/startblock" -o ",\"" \ | |
-v name -o "\",\"" -m "ancestor-or-self::directory" -v "name" -o "/" -b \ | |
-o "\"" -n ${INPUT_FILE} | sort -n | awk -F',' '{gsub(/"/,"");print $3 $2}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment