#!/bin/csh -f # dbsave # ----------------------------------------------------------------------------- # C shell script to dump data from the HHL MySQL DB. # ----------------------------------------------------------------------------- # Revision History: # $Log$ # ----------------------------------------------------------------------------- if ($1 == "-?" || $1 == "-h" || $1 == "help") then set verb = $0 echo "Usage: $verb:t" exit 1 endif #set echo mysqldump -u root \ -p${MYSQL_PW} \ --order-by-primary # Sorted is easier to diff w/other dumps \ --complete-insert # Include column names in INSERTS \ --opt # Default. Useful set of default options: \ # --add-drop-table \ # --add-locks \ # --create-options \ # --disable-keys \ # --extended-insert (overridden below) \ # --lock-tables \ # --quick \ # --set-charset \ --add-drop-table # Default. Harmless since we expect to \ # only run on dropped DB anyhow, for now. \ --add-locks # Default. Faster loads \ --create-options # Default. MySQL-specific table options. \ --disable-keys # Default. Disable keys while loading \ --skip-extended-insert # Only one DB row per INSERT \ --lock-tables # Default. Lock all tables for data \ # consistency in dump file. \ --quick # Don't try to buffer entire table in RAM \ --databases # CREATE DATABASE, USE \ # Also DROP DATABASE if --add-drop-database\ --skip-add-drop-database # Safer to require manual drop \ --dump-date # Show date/time as a comment. Change to \ # --skip-dump-date for identical diffs of \ # dump files. \ --skip-no-create-info # Default. Do want CREATE TABLEs \ --skip-no-data # Default. Do want INSERTs \ --routines # Stored procedures and functions, if any \ --triggers # Triggers, if any \ hhlwebdb #echo "Don't forget to also save the external image and other files."