Welcome to PCCS-Linux.COM Hello, and welcome to the PCCS-Linux Home Page.
Your last visit was !!!
Your Browser is running on Other
 
Download install MySQL
#!/bin/sh

# USAGE: dload.sh ftp://hostname.com/pub/filename.tar.gz

path=$1
`wget -U lynx $path`


Using sh to backup mysql databases

#!/bin/sh
# Filename: backup.sh
# Function: do daily backups of databases
# updated 
# -- added changelog to this file



# Change To fit your system
userid=root
# On my development system I don't have the root password
# You will also need add -p${password} to
#password=passwd

# Create a cron job to run every night at 4:30am 
# 30 04 * * * /patch/to/pccs_mysqladm/bin/backup.sh

# Location of Mysql bin directory
mysqlbinclient="/usr/local/bin/mysql -u${userid}"
mysqlbindump="/usr/local/bin/mysqldump -u${userid}"

# Location of Mysql Database backup directory
dbbackupdir=/home/www/htdocs/pccs_mysqladm/dumpfiles

$mysqlbinclient  -e 'SHOW DATABASES' | sed 's/|//g' | grep -v 'Database' \
 | while read dbname; do
if [ -d $dbbackupdir/${dbname}_db ]; then
echo -n  2>/dev/null 
else
 mkdir $dbbackupdir/${dbname}_db
fi

curr_time=`date | sed 's/ //g' | sed 's/:/_/g'` 
$mysqlbindump --opt ${dbname}  >
$dbbackupdir/${dbname}_db/${curr_time}.${dbname}_dumpsql.BACKUP 2>/dev/null


Page hits 58 on :02:47



This web site is prepared and maintained by Chauncey Thorn.
The information contained in this site was valid at the time of posting.
Chauncey Thorn, assumes no liability for damages incurred directly or indirectly as a result of errors, omissions or discrepancies.

Remember most of the content here are my notes...

All logos and trademarks in this site are property of their respective owner. All the rest © by PCCS-Linux.COM

PCCS-Linux.COM ::ource Advocate Articles catalogue
2000 2002