Exporting a MySQL database: Difference between revisions

>Samthecrazyman
m Removed escaping statement, not needed anymore
m Changed date code in cron to correct order
Line 32: Line 32:


=== Creating the cron job ===
=== Creating the cron job ===
* Log on as <code>root</code> and start KDE Task Scheduler from the Kickstart menu (this can be found by typing 'cron'.
* Log on as <code>root</code> and start KDE Task Scheduler from the Kickstart menu (this can be found by typing 'cron').
* Select 'System Cron' from the radio buttons in the top task bar.
* Select 'System Cron' from the radio buttons in the top task bar.
* Select 'New entry'.
* Select 'New entry'.
Line 40: Line 40:
** <code>PASSWORD</code> should be changed to the password used for the user. Notice, no space between the switch <code>-p</code> and <code>PASSWORD</code> or the job will fail.
** <code>PASSWORD</code> should be changed to the password used for the user. Notice, no space between the switch <code>-p</code> and <code>PASSWORD</code> or the job will fail.
** <code>/path/to/backup</code> should be the full path to the location you want the backup to take place.  
** <code>/path/to/backup</code> should be the full path to the location you want the backup to take place.  
** <code>backup-name</code> should be the name of the backup file, <code>$(date +%Y-%m-%d)</code> adds the date to the place you place it in the file name, especially handy if you want to keep your backups every day. Starting with the year as opposed to the day makes sorting the files in lists a lot easier.
** <code>backup-name</code> should be the name of the backup file, <code>$(date +%d-%m-%Y)</code> adds the date to the place you place it in the file name, especially handy if you want to keep your backups every day. Starting with the year as opposed to the day makes sorting the files in lists a lot easier.
* Select the user you want this to run under (probably root)
* Select the user you want this to run under (probably root)
* Now choose the time and date you would like the backup to take place. If you would like it to happen every day, select the 'Run every day' tick box and this will select all the relevant options, leaving you just to choose a time.
* Now choose the time and date you would like the backup to take place. If you would like it to happen every day, select the 'Run every day' tick box and this will select all the relevant options, leaving you just to choose a time.