Skip to content

Instantly share code, notes, and snippets.

@scottopell
Created August 19, 2017 15:51
Show Gist options
  • Save scottopell/0a6380b616e886a0c14b08629222a0da to your computer and use it in GitHub Desktop.
Save scottopell/0a6380b616e886a0c14b08629222a0da to your computer and use it in GitHub Desktop.
Compress files with xz and upload archive to google cloud

I always forget these steps and have to google for them, even though they're super simple

Prereq:

  • pip install gsutil
  • gsutil config, have your project id ready.
  1. tar --create --verbose --xz --file images.tar.xz /directory/containing/images/*
  2. gsutil cp images.tar.xz gs://<bucket name>

to extract: tar -xf file.tar.xz

xz is supposed to be the "best" general purpose compression algorithm in terms of compression ratio, but its also slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment