I want to automatize the backup of my databases and files with cron. Should I add the following lines to crontab ?
mysqldump -u root -pPASSWORD database_name | gzip > /home/backup/database_`date +\%m-\%d-\%Y`.sql.gz
svn commit -m "Committing the working copy containing the database dump"
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
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 .