You are not logged in.

#1 2009-07-11 16:23:24

Vladman
Member
Registered: 2009-01-28
Posts: 118

Help with rsnapshot please (mysql)

Hello, I'm trying to configure rsnapshot to backup my server over ssh.
I need to backup some directories and mysql dabase.

So far I've got everything working but the mysql part.
Its a bit unclear where the problem might be from the logs even with loglevel at 5.
Right now it just makes empty dumps hmm

the bit from rsnapshot.conf

# EXAMPLE.COM
backup_script    /bin/date "+ backup of arch started at %c"    unused1
backup    vlad@arch:/home/vlad/public_html/site1/    arch/    +rsync_long_args=--bwlimit=16,exclude=core
backup    vlad@arch:/etc/    arch/    exclude=mtab,exclude=core
backup_script    /home/vladman/backup_mysql.sh vlad@arch "mysqldump -A > /var/db/dump/mysql.sql"    unused2
backup    vlad@arch:/var/db/dump/    vlad/
backup_script    /bin/date    "+ backup of vlad ended at %c"    unused9

the backup_mysql.sh

#!/bin/bash

##############################################################################
# backup_mysql.sh
#
# by Nathan Rosenquist <nathan@rsnapshot.org>
# http://www.rsnapshot.org/
#
# This is a simple shell script to backup a MySQL database with rsnapshot.
#
# The assumption is that this will be invoked from rsnapshot. Also, since it
# will run unattended, the user that runs rsnapshot (probably root) should have
# a .my.cnf file in their home directory that contains the password for the
# MySQL root user. For example:
#
# /root/.my.cnf (chmod 0600)
#   [client]
#   user = root
#   password = thepassword
#   host = localhost
#
# This script simply needs to dump a file into the current working directory.
# rsnapshot handles everything else.
##############################################################################

# $Id: backup_mysql.sh,v 1.6 2007/03/22 02:50:21 drhyde Exp $

umask 0077

# backup the database
/usr/bin/mysqldump --all-databases > mysqldump_all_databases.sql

# make the backup readable only by root
/bin/chmod 600 mysqldump_all_databases.sql

.my.cnf on local machene

# /root/.my.cnf (chmod 0600)
   [client]
   user = root
   password = mypassword
   host = localhost

This is what I have so far...
Also I think it should be adding dates to folder names? it does not...

Everything checks out in the sest mode...

If someone can help I would really appreciate it!
If you need to see the logs let me know.

Last edited by Vladman (2009-07-11 16:25:48)

Offline

#2 2009-07-11 20:36:45

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: Help with rsnapshot please (mysql)

Take it easy, and read this tutorial smile

http://dev.mysql.com/doc/refman/6.0/en/ … overy.html

Offline

#3 2009-07-12 15:16:53

Vladman
Member
Registered: 2009-01-28
Posts: 118

Re: Help with rsnapshot please (mysql)

OK thanks, I will do some more reading.

Offline

Board footer

Powered by FluxBB