Skip to content

Instantly share code, notes, and snippets.

@tyler-johnson
Created May 31, 2015 21:06
Show Gist options
  • Save tyler-johnson/8fb13088f751a9c4968b to your computer and use it in GitHub Desktop.
Save tyler-johnson/8fb13088f751a9c4968b to your computer and use it in GitHub Desktop.
Runs tar+gzip on current directory's files and streams data to s3.
find . -type f -mindepth 1 | awk -v base="./" "{ len=length(base); if (substr(\$1,1,len) == base) print substr(\$1,len+1); else print $1 }" | tar --files-from=- -cvf - | gzip -c | aws s3 cp - s3://bti-static/backup.tgz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment