Skip to content

Commit

Permalink
a mirror tool
Browse files Browse the repository at this point in the history
  • Loading branch information
leifj committed Jan 23, 2018
1 parent f982bd7 commit 2868709
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/mirror-mdq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

base=$1
target=$2
dir=`mktemp -d`

function cleanup() {
rm -rf $dir
}

trap cleanup EXIT

mkdir -p $target && (
cd $dir
WGET_ARGS="--mirror --no-host-directories -q"
idx_obj=".well-known/webfinger?rel=urn:oasis:names:tc:SAML:2.0:metadata"
wget $WGET_ARGS "$base/$idx_obj" && jq -r '.links[].href' < "$idx_obj" | wget $WGET_ARGS -i -
)

rsync -az --delete $dir/ $target/

0 comments on commit 2868709

Please sign in to comment.