Date: Fri, 1 Jun 2007 22:45:11 -0400
From: "Zeffie" <[EMAIL PROTECTED]>
Subject: Re: [cobaltfacts] PHP and MySQL upgrade
To: "Cobaltfacts mailing list" <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
        reply-type=response


I have a RaQ4 with 4.3.10 and MySqL 3.23.49

RaQAid has 2 free packages to update the MySql and PHP
http://www.rackaid.com/free/
mysql and php



I haven't used them but you can get updated versions via my update page and
a I made PHP 4 or 5 / MySQL 5 versions too


Has anyone used them, and what's the best way to backup the 3.23 MySql
databases?
Thom


the easy way is to shutdown mysql and tar em up...

tar -czpvf /home/whatever.tgz /home/mysql

ok.. this area is done for now :)

I have a shell script that I have cron execute every two days. On my personal server, I have it do 8 rotations. With a dump happening every 2 days, 8 rotations means I have data up to 16 days old. You can adjust the frequency by how often the cron job fires. You can have more rotations by editing the appropriate parts of the script. There are four variables you need to set which are listed near the beginning of the script. Note that I'm using the MySQL 'root' user to do the dumps. This is NOT the same 'root' as the RaQ itself. You could tighten up MySQL security by creating a user with appropriate privileges and using that instead of 'root'.

It's not too long so here it is:

#!/bin/sh

#
#  Directory we store the dumps in.
#
backupdir=/path/to/dump/directory
dumpdir=dump
user=root
pass=PASSWORD

#
#  Make sure output directory exists.
#
if [ ! -d $backupdir ]; then
            mkdir -p $backupdir
fi
cd $backupdir

#
# Create back-up dirs if necessary
#
for x in 0 1 2 3 4 5 6 7; do
    if [ ! -d $dumpdir.$x ]; then
        mkdir -p $dumpdir.$x
    fi
done

#
# Rotate existing backup dirs
# Directory indexes from 0 to 7 allow a total of eight back-ups to be rotated and # retained. Increase the number only after estimating the diskspace required by
# that many retained back-ups!

mv $dumpdir.7 $dumpdir.del
mv $dumpdir.6 $dumpdir.7
mv $dumpdir.5 $dumpdir.6
mv $dumpdir.4 $dumpdir.5
mv $dumpdir.3 $dumpdir.4
mv $dumpdir.2 $dumpdir.3
mv $dumpdir.1 $dumpdir.2
mv $dumpdir.0 $dumpdir.1

#
# Create new backups
#
mkdir -p $dumpdir.0
for i in /var/lib/mysql/*/; do
    dbname=`basename $i`
    mysqldump --user=$user --pass=$pass $dbname |  \
    gzip > $backupdir/$dumpdir.0/$dbname.gz
done

#
# Clean up
#
chown -R root.root $backupdir/*
rm -rf $dumpdir.del


--
Alex Alegado mailto:[EMAIL PROTECTED] AIM/iChat: alexaleghetto
http://www.alsplace.com  http://www.thoughtshop.net
Never wrestle with a pig because you both get dirty and the pig likes it



_______________________________________________
Cobaltfacts site list
[email protected]
http://list.cobaltfacts.com/mailman/listinfo.cgi/cobaltfacts

Reply via email to