Skip to content

Instantly share code, notes, and snippets.

@islander
Last active August 29, 2017 22:58
Show Gist options
  • Select an option

  • Save islander/5b8b4dc3b2ba1b7f6a52dbdb91176903 to your computer and use it in GitHub Desktop.

Select an option

Save islander/5b8b4dc3b2ba1b7f6a52dbdb91176903 to your computer and use it in GitHub Desktop.
Save MySQL functions, procedures and triggres
#!/bin/sh
# Save MySQL functions, procedures and triggres
DBNAME=$1
DUMPFILE=/var/backup/mysql/$DBNAME/routines.sql
mkdir -p /var/backup/mysql/$DBNAME/
mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt $DBNAME > $DUMPFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment