# +----+----+----+----+ # | | | | | # Author: Mark David Scott Cunningham | M | D | S | C | # +----+----+----+----+ # Created: 2014-06-28 # Updated: 2015-01-10 # # #!/bin/bash ## http://www.tutorialspoint.com/mysql/mysql-using-sequences.htm ## ^^^ great reference for command examples ## https://dev.mysql.com/doc/refman/5.6/en/show-table-status.html ## ^^^ much faster way to get rows, data, index, data_free if necessary # Taste the rainbow BLACK=$(tput setaf 0); RED=$(tput setaf 1) GREEN=$(tput setaf 2); YELLOW=$(tput setaf 3) BLUE=$(tput setaf 4); PURPLE=$(tput setaf 5) CYAN=$(tput setaf 6); WHITE=$(tput setaf 7) BRIGHT=$(tput bold); NORMAL=$(tput sgr0) BLINK=$(tput blink); REVERSE=$(tput smso) UNDERLINE=$(tput smul) getusr(){ pwd | sed 's:^/chroot::' | cut -d/ -f3; } echo; runonce=0; if [[ $1 =~ ^-.*$ ]]; then SITEPATH='.'; opt="$1"; shift; param="$@"; else SITEPATH="$1"; opt="$2"; shift; shift; param="$@"; fi; tables="core_cache core_cache_option core_cache_tag core_session dataflow_batch_import dataflow_batch_export\ index_process_event log_customer log_quote log_summary log_summary_type\ log_url log_url_info log_visitor log_visitor_info log_visitor_online\ report_viewed_product_index report_compared_product_index report_event catalog_compare_item" # prefix=$(grep -i 'table_prefix' $SITEPATH/app/etc/local.xml 2> /dev/null | sed 's/.*A\[\(.*\)]].*/\1/'); # adminurl=$(grep -i 'frontname' $SITEPATH/app/etc/local.xml 2> /dev/null | sed 's/.*A\[\(.*\)]].*/\1/'); prefix="$(echo 'cat /config/global/resources/db/table_prefix/text()' | xmllint --nocdata --shell $SITEPATH/app/etc/local.xml | sed '1d;$d')" adminurl="$(echo 'cat /config/admin/routers/adminhtml/args/frontName/text()' | xmllint --nocdata --shell $SITEPATH/app/etc/local.xml | sed '1d;$d')" _magdbusage(){ echo " Usage: magdb []