From: Silvio Rhatto Date: Sun, 2 Aug 2015 19:08:52 +0000 (-0300) Subject: Use two levels of directories X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=cdd9d09f978d69ad207697f94289bfa14064c5ca;p=httruta.git Use two levels of directories --- diff --git a/lib/httracker/functions b/lib/httracker/functions index 2a63ffa..2d3e35a 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -21,11 +21,16 @@ function httracker_get { # 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