Skip to content

Instantly share code, notes, and snippets.

@larsvilhuber
Created September 30, 2016 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsvilhuber/d2900f5fd513d186cde1864cbf9edc93 to your computer and use it in GitHub Desktop.
Save larsvilhuber/d2900f5fd513d186cde1864cbf9edc93 to your computer and use it in GitHub Desktop.
Mirroring of Stata packages from Repec
#!/bin/bash
SRCURL=http://fmwww.bc.edu/repec/bocode/
if [[ -z $1 ]]
then
cat << EOF
$0 start
mirror $SRCURL to this directory
EOF
exit 0
fi
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $SRCURL
# clean up
rm fmwww.bc.edu/repec/repec.css
rm fmwww.bc.edu/ecstyle.css
find fmwww.bc.edu -name index.html\* -exec rm {} \;
# put a note
sed "s/XXDATEXX/$(date +%F)/" stata.toc > fmwww.bc.edu/repec/bocode/stata.toc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment