Skip to content

Instantly share code, notes, and snippets.

@DagW
Created April 18, 2017 08:11
Show Gist options
  • Save DagW/e69625f0681e76c2237780a7caae8ca5 to your computer and use it in GitHub Desktop.
Save DagW/e69625f0681e76c2237780a7caae8ca5 to your computer and use it in GitHub Desktop.
#!/bin/bash
TMPPATH=/tmp/site/
BUCKET=s3://wullt.net/
rm -rf $TMPPATH
wget \
--recursive \
--no-clobber \
--page-requisites \
--convert-links \
--restrict-file-names=windows \
--domains DOMAIN.TO.SYNC.COM \
--no-parent \
$TMPPATH
/usr/local/bin/aws s3 sync $TMPPATH $BUCKET
#Optional, I want to serve files as "domain.com/about" without extension
aws s3 cp \
--include "*" \
--exclude "*.*" \
--content-type="text/html" \
--metadata-directive="REPLACE" \
--recursive \
$BUCKET \
$BUCKET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment