Exporting a MySQL database: Difference between revisions
m Changed date code in cron to correct order |
m Changed date code in cron command to correct order |
||
| Line 35: | Line 35: | ||
* 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'. | ||
* In the command box, we need to formulate a command. The following command gives most of the things you may need in the command and can be adapted to suit your needs:<br><pre>mysqldump -A -u USER -pPASSWORD > /path/to/backup/backup-name-$(date +% | * In the command box, we need to formulate a command. The following command gives most of the things you may need in the command and can be adapted to suit your needs:<br><pre>mysqldump -A -u USER -pPASSWORD > /path/to/backup/backup-name-$(date +%d-%m-%Y).sql</pre> | ||
** <code>-A</code> switch makes <code>mysqldump</code> backup all databases. | ** <code>-A</code> switch makes <code>mysqldump</code> backup all databases. | ||
** <code>USER</code> should be changed to the user. | ** <code>USER</code> should be changed to the user. | ||