Difference between revisions of "Database Backup"
From Amahi Wiki
Line 13: | Line 13: | ||
''BACKUPDIR="/srv/backup/db" on line 51 to: | ''BACKUPDIR="/srv/backup/db" on line 51 to: | ||
BACKUPDIR="/var/hda/files/db" | BACKUPDIR="/var/hda/files/db" | ||
− | + | ''MAILADDR="maintenance@example.com"'' on line 65 to: | |
MAILADDR="root" | MAILADDR="root" | ||
''DBEXCLUDE=""'' on line 76 to: | ''DBEXCLUDE=""'' on line 76 to: | ||
Line 21: | Line 21: | ||
''LATEST=no'' on line 94 to: | ''LATEST=no'' on line 94 to: | ||
LATEST=yes | LATEST=yes | ||
− | * | + | * Copy the file from ''/tmp'' to ''/usr/local/bin'' and set the permissions: |
− | + | cd /usr/local/bin | |
+ | cp /tmp/automysqlbackup-2.5.1-01.sh . | ||
+ | chmod 755 automysqlbackup-2.5.1-01.sh | ||
+ | * Set as a daily cron job: | ||
+ | cd /etc/cron.daily | ||
+ | ln -s /usr/local/bin/automysqlbackup-2.5.1-01.sh | ||
+ | * | ||
== Tips == | == Tips == |
Revision as of 16:33, 11 November 2010
It's good practice to periodically backup up your database. This functionality is coming to Amahi soon, but until then there is a simple way to automatate it. Follow the steps below to help keep your data safe.
Installation
- Create a share called Database with the path of /var/hda/files/db.
- Download the script AutoMySQLBcckup file to /tmp directory.
cd /tmp wget http://downloads.sourceforge.net/project/automysqlbackup/AutoMySQLBackup/AutoMySQLBackup%20VER%202.5/automysqlbackup-2.5.1-01.sh
- Some changes will need to be made for this to work on your HDA. Use your favorite text editor and update as follows:
USERNAME=debian on line 39 to:
USERNAME=root
PASSWORD= on line 42 to:
PASSWORD=hda
BACKUPDIR="/srv/backup/db" on line 51 to:
BACKUPDIR="/var/hda/files/db"
MAILADDR="maintenance@example.com" on line 65 to:
MAILADDR="root"
DBEXCLUDE="" on line 76 to:
DBEXCLUDE="information_schema"
CREATE_DATABASE=no on line 79 to:
CREATE_DATABASE=yes
LATEST=no on line 94 to:
LATEST=yes
- Copy the file from /tmp to /usr/local/bin and set the permissions:
cd /usr/local/bin cp /tmp/automysqlbackup-2.5.1-01.sh . chmod 755 automysqlbackup-2.5.1-01.sh
- Set as a daily cron job:
cd /etc/cron.daily ln -s /usr/local/bin/automysqlbackup-2.5.1-01.sh