Skip to content

Instantly share code, notes, and snippets.

@ianlintner-wf
Last active January 4, 2016 05:59
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 ianlintner-wf/8579363 to your computer and use it in GitHub Desktop.
Save ianlintner-wf/8579363 to your computer and use it in GitHub Desktop.
#! /bin/bash
#name resotre script restore.sql to automate via script
echo -n "Specify Database: "
read -e DB
setterm -background $DB
mysqldump -u dbuser -h server $DB << zap.sql
mysqldump -u dbuser -h server $DB << restore.sql
SELECT Concat('TRUNCATE TABLE ', TABLE_NAME, ';') FROM INFORMATION_SCHEMA.TABLES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment