31,029
edits
| Line 77: | Line 77: | ||
* ''date'' can be replaced with a date, recommanded format is YYYYMMDD, with YYYY the year (ex. 2011), MM is month number (ex. 05) and DD is day in month (ex. 18). | * ''date'' can be replaced with a date, recommanded format is YYYYMMDD, with YYYY the year (ex. 2011), MM is month number (ex. 05) and DD is day in month (ex. 18). | ||
With value used as example, we will get a dump file called ''mysqldump_databasename_3.7_20110518.sql. | With value used as example, we will get a dump file called ''mysqldump_databasename_3.7_20110518.sql. | ||
If you want to have your file compressed (compressé) : | |||
<source lang="bash"> | |||
mysqldump databasename -h host -u user -pyourpass -l --single-transaction -K --add-drop-table=TRUE --tables -c -e --hex-blob --default-character-set=utf8 | bzip2 > mysqldump_databasename_version_date.bz2 | |||
</source> | |||
Dump file will be generated with a bzip compressed format. | |||
'''Example:''' | |||
With Linux, to make a regular backup at 1:30 each day into file mysqldump_databasename_DD.sql, you can add this into your cron file: | |||
<source lang="bash"> | |||
30 1 * * * mysqldump databasename -h host -u user -pyourpass -l --single-transaction -K --add-drop-table=TRUE --tables -c -e --hex-blob --default-character-set=utf8 | bzip2 > mysqldump_databasename_`date +%d`.sql.bz2 | |||
</source> | |||
=== Using phpMyAdmin === | === Using phpMyAdmin === | ||