To back up your database, you can use the following script:
To be able to run this script properly, you first need to install:
- perl-Term-ProgressBar
- perl-DBD-MySQL
- perl-DBI
e.g. CentOS
$ yum install perl-Term-ProgressBar perl-DBD-MySQL perl-DBI
To run the script, use:
$ db_backup --backup_folder 'backup_folder' > /var/log/backup_db/backup_db.log 2>&1
Arguments:
$ --mysql_user
$ --mysql_password
$ --mysql_host
$ --mtime
$ --mycnf
|
Optional |
Description |
Default |
--backup_folder |
no | path to the backup | |
--mysql_user |
yes | SQL user for backup | |
--mysql_password |
yes | SQL password for backup | |
--mysql_host |
yes | SQL host | localhost |
--mytime |
yes | retention time in days | 7 |
--mycnf |
path to .my.cnf file optional if other values are set |
/root/.my.cnf | |
--help |
full documentation |
Comments
0 comments
Article is closed for comments.