Created
April 15, 2017 15:10
-
-
Save anonymous/f42dcffbc5a64174d1f19ca664d8f92b to your computer and use it in GitHub Desktop.
hardlinks duplicates in steam directories, is very careful not to link too much
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 | |
set -x | |
function hlink { | |
set -x | |
name="$2"/$(echo $1 | grep -oPe '(?<=/steamapps/).*$') | |
if test -f "$name"; then | |
rdfind -makeresultsfile false -makehardlinks true "$1" "$name" | |
fi | |
} | |
export -f hlink | |
a=$(echo "$1" | sed 's/\/$//') | |
b=$(echo "$2" | sed 's/\/$//') | |
find "$a"/steamapps -type f -exec bash -c "hlink '{}' $b/steamapps" \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment