Changes

From Amahi Wiki
Jump to: navigation, search
914 bytes added ,  15:54, 18 June 2020
{{MessageBox|backgroundcolor = #faa|image =Warning.png|heading =WARNING|message = This is recommended only for advanced users, proceed with caution.}}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 automatize automate it. This can be done using [http://members.multimania.cosourceforge.uknet/wipe_outprojects/automysqlbackup/ AutoMySQLBackup] script.
__NOTOC__
== Features ==
== How to Install ==
<br />
<b><u><big>Ubuntu</big></u></b>
* install via apt-get
sudo apt-get install automysqlbackup
* edit the config file located at <code>/etc/default/automysqlbackup</code>
sudo nano /etc/default/automysqlbackup
* At the bare minimun, in the config file, edit the BACKUPDIR variable
* run automysqlbackup to see if it works (you should get backups added to your backupdir directory:
sudo automysqlbackup
* Edit cron:
sudo crontab -e
* add the following for running cron everyday at midnight
0 0 * * * /usr/sbin/automysqlbackup
<br />
<b><u><big>Fedora</big></u></b>
* Create a share called '''dbbackup'''.
* Download the script to ''/tmp'' directory.
<pre style="white-space: pre-wrap; word-break: keep-all;">cd /tmp wget http://downloads.sourceforge.net/project/automysqlbackup/AutoMySQLBackup/AutoMySQLBackup%20VER%202.5/automysqlbackup-2.5.1-01.sh</pre>
* Some changes will need to be made for this to work on your HDA. As '''root''' user, update lines indicated in ''automysqlbackup-2.5.1-01.sh'' to read as follows:
  <pre>Line 39: '''USERNAME=root''' Line 4942: '''PASSWORD=hda''' Line 51: '''BACKUPDIR="/var/hda/files/dbbackup'''" Line 65: '''MAILADDR="root"''' Line 76: '''DBEXCLUDE="information_schemaperformance_schema mysql"''' Line 79: '''CREATE_DATABASE=yes''' Line 94: '''LATEST=yes'''</pre><br />
* Rename and copy the ''automysqlbackup-2.5.1-01.sh'' from ''/tmp'' to ''/usr/bin'' and set the permissions:
<pre>cd /usr/bin cp /tmp/automysqlbackup-2.5.1-01.sh automysqlbackup chmod 755 automysqlbackup</pre>
* Set ''automysqlbackup'' as a daily cron job (Optional):
<pre>cd /etc/cron.daily ln -s /usr/bin/automysqlbackup</pre>
== Tips ==
* This script is well documented. Options can be easily customized To change day of week (1=Monday thru 7=Sunday; defaults to meet your specific HDA requirements. The guidance can be found in 6=Saturday) for backup, update the number on the script file, starting at following line 110.in ''automysqlbackup'' as '''root''' user: Line 85: DOWEEKLY=6
* To run anytime, as root do the following:
automysqlbackup* This script is well documented. Options can be easily customized to meet your specific HDA requirements. The guidance can be found in the ''automysqlbackup'', starting at line 110.
'''NOTE:''' When it's run the first time, it will create the directory structure automatically if it does not already exist.
12,424

edits