mysql dump

1 view
Skip to first unread message

deepak gusain

unread,
Mar 13, 2019, 6:23:55 PM3/13/19
to cg...@googlegroups.com
Hi Team,

I had buy another cpanel for the hosting and it's based on Centos 6

I had facing issue, with mysql dump,

I want a script which can help me for mysql dump,that script help me for  my all databases dump with same project wise name, I try to find in the google. but unable to find. 

Can any one help me on this issue.

i also try a script but it's show this message. 

#!/bin/bash
#MYSQL_PWD=`cat /etc/psa/.psa.shadow`
DT=`date +%H-%M-%d-%m-%Y`
if [ -d mysql-dump ]
then
echo "mysql-dump folder exist process will be start"
else
mkdir mysql-dump
echo "mysql-dump created process will be start"
fi
if [ -d mysql-dump ]
then
mkdir mysql-dump/$DT
echo "show databases" | mysql -u root -p > mysql-dump/$DT/mysqlinfo
if [ -f mysql-dump/$DT/mysqlinfo ]
then
for n in `cat mysql-dump/$DT/mysqlinfo`
do
mysqldump -u root -p --database $n > mysql-dump/$DT/$n.sql 2> /dev/null
done
fi
fi

Note :- The MSG /mysql-dump folder exist process will be start


--
Regards
Deepak Gusain
RHCSA, MCITP, CCNA
M.no:- 9417248523
Reply all
Reply to author
Forward
0 new messages