mysql - How to automate backups in mysqldump from one server to an external disk -


i need in configuring mysqldump in order automatically download backups 1 server external disk in fixed time (everyday @ 6:00 pm). if mysqldump unable that, can suggest software?

you can use operating system's scheduler automatically run mysqldump command @ desired times, e.g. cron on linux , task scheduler on windows.

to have mysqldump write external disk, can mount disk destination path reachable mysqldump , use in output path. specify output path, can either use > redirection or --result-file option.

both approaches work on linux/unix distinction important windows redirection won't work using powershell. because redirection on powershell produces utf-16 using redirection cannot read. --result-file option provide ascii output can read.

windows examples

c:\> mysqldump.exe –e –u[username] -p[password] -h[hostname] [dbname] > [c:\path\to\mybackup.sql] c:\> mysqldump.exe –e –u[username] -p[password] -h[hostname] [dbname] --result-file [c:\path\to\mybackup.sql] 

linux/unix examples

# mysqldump -u[username] -p[password] -h[hostname] [dbname] > [/path/to/mybackup.sql] # mysqldump -u[username] -p[password] -h[hostname] [dbname] --result-file [/path/to/mybackup.sql] 

more information available here:

depending on backup requirements, may want consider other options such percona xtrabackup, lvm snapshots (e.g. mylvmbackup), etc. percona xtrabackup presentation has comparison table on slide 3.


Comments