mysqlbackup.sh

0_4Bl4emIjbhyt18Y7.jpeg

#!/bin/sh
DBSERVER=
DATABASE=
FILE=${DATABASE}-`date +"%Y%m%d"`
USER=
PASS=

unalias rm     2> /dev/null
rm ${FILE}     2> /dev/null
rm ${FILE}.gz  2> /dev/null

mysqldump --opt --protocol=TCP --user=${USER} 
--password=${PASS} --host=${DBSERVER} ${DATABASE} > 
${FILE} 2> /dev/null

gzip $FILE
echo "${FILE}.gz was created"

AUTHOR

Hi, Gustavo Zapico-san. Thank you for writing your first article. I am looking forward to sharing your knowledge.

READ NEXT

Boostlog is an online community for developers
who want to share ideas and grow each other.

Delete an article

Deleted articles are gone forever. Are you sure?