Skip to content

Instantly share code, notes, and snippets.

@pcraciunoiu
Created March 1, 2011 19:44
Show Gist options
  • Save pcraciunoiu/849740 to your computer and use it in GitHub Desktop.
Save pcraciunoiu/849740 to your computer and use it in GitHub Desktop.
Uses pipe viewer to show progress while gunzipping/importing a database.
#!/bin/sh
if [ $# -lt 2 ]; then
echo "USAGE: $0 <filename> <database>"
exit 1
fi
pv -cN source < $1 | gunzip | pv -cN gunzip | mysql $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment