# Options
local url="$1"
local hash="`echo $1 | sha1sum | cut -d ' ' -f 1`"
+ local first="`echo $hash | cut -c 1-2`"
+ local second="`echo $hash | cut -c 3-4`"
echo -n "Processing $url..."
# Set target and make sure it exists
- TARGET="$MIRRORS/$hash"
+ # We use two levels of directories used for hashing,
+ # to prevent too many things ending up in any one directory.
+ # See https://git-annex.branchable.com/internals/
+ TARGET="$MIRRORS/$first/$second/$hash"
mkdir -p $TARGET
# We already got this one