Skip to content

Instantly share code, notes, and snippets.

@l1x
Created July 11, 2017 09:41
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 l1x/a67e35d63b85359bd9d4c686be9eb9af to your computer and use it in GitHub Desktop.
Save l1x/a67e35d63b85359bd9d4c686be9eb9af to your computer and use it in GitHub Desktop.
mysql --database=achoo_backend --execute="show tables" --silent --batch | while read tablename ; do
echo "mysqldump --where="1=1 ORDER BY id DESC LIMIT 200" achoo_backend $tablename > $tablename.sql" ;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment