Take the 2-minute tour ×

I want to automatize the backup of my databases and files with cron. Should I add the following lines to crontab ?



1) First of all, is this a good approach?
2) It is not clear how to specify the repository and the working copy with svn.
3) How can I run svn only when the mysqldump is done and not before ? Avoiding conflicts

Any other tip ? thanks

share|improve this question
If you are using a public svn server please consider encrypting the backups with GPG before committing. –  João Pinto Jan 3 '11 at 12:04
@João Pinto Thanks for tip. It is a private one.. –  Patrick Jan 3 '11 at 12:13
Is there a good reason for you to use svn to store the backups ? I don't see any benefit from using a revision control system to manage a single binary file. –  João Pinto Jan 3 '11 at 12:26
MySQL dumps are not binary, but a text file with all the SQL statements (CREATE TABLE, INSERT, etc...) needed to recreate the database. –  Javier Rivera Jan 3 '11 at 12:29
@João Pinto I'm using SVN to make backup of several folders and I need somehow to include the database as well. So I'm making a dump and committing it as file. –  Patrick Jan 3 '11 at 12:31

1 Answer 1

up vote 0 down vote accepted

1) The mysql dump for backup itself is the usual approach, I don't see any benefit from using svn to store the backups

2) Better move this to it's own question (svn related)

3) By doing the commands in sequence in a script you are already enforcing that, the svn commit is only executed after the mysqldump | gzip finishes .

share|improve this answer

Your Answer


