Index

Notes

  1. Window 1
  2. Window 2
  3. General notes

Useful Information

  1. Guardian Restore
  2. Cloud Restore
  3. Raid Repair
    1. Adaptec
    2. Software Raid
    3. LSI
    4. Software raid to Hardware raid
  4. Rack Mount Rows
  5. Mysql dump
  6. Interwerx
  7. WHM API
  8. Chasis swap
  9. Windows commands
  10. xpaste
  11. find docroot
  12. clown funnyness
  13. ssh keys
  14. duff
  15. subdomain finding ideas
  16. RAM

Mysql dump

if [ "$(basename $PWD)" == "mysql" ];then echo -e "\e[0;36m[ ensuring proper permissions ]\e[0m";chown -cR mysql. $PWD && chmod -c 751 /home/temp /home/temp/restore.[0-9]*;echo -e "\e[0;36m[ PRESS ENTER IF NO ERRORS, ELSE ^C ]\e[0m";read;(echo -e "\e[0;36m[ starting mysql ]\e[0m";mysqld --datadir=$PWD --socket=$PWD/mysql.sock --pid-file=$PWD/mysql.pid --log-error=$PWD/mysql.err --skip-grant-tables --skip-networking --user mysql > /dev/null &);sleep 10;if [ -S "$PWD/mysql.sock" ];then mkdir -vp "$PWD/dumps";mysql -S mysql.sock -Nse "SHOW DATABASES;" | egrep -v "mysql|schema|dumps" | while read db;do echo -e "dumping [\e[0;36m$db\e[0m]";mysqldump -S mysql.sock "$db" > "$PWD/dumps/$db";done;mysqladmin -S mysql.sock shutdown;else echo -e "\n\n\e[0;31m[ socket file does not exist ]\e[0m";fi;else echo -e "\n\n\e[0;31m[ not in mysql dir? ]\e[0m";fi

your mysql data has to be in /home/temp/restore.$ticket#/mysql



stuff you need: mysql ibdata1 ib_logfile* my_db
rsync -avHP mysql ibdata1 ib_logfile* my_db IP:/home/temp/$user/


#dir=/home/restore.$ticketid/mysql
dir=$(pwd)
chown mysql. $dir -R;chmod 751 $dir

mysqld --datadir=$dir --socket=$dir/socket.mysql --pid-file=$dir/mysql.pid --log-error=$dir/mysql.err --skip-grant-tables --skip-networking --user=mysql &

mysqldump -S $dir/socket.mysql $database > $database.sql

mysqladmin -S $dir/socket.mysql shutdown