How to automatically make backups mysql?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
7 views
Want to do a backup of some mysql databases.
That would automatically have made a backup, went to the mailbox and threw off my computer.

How do you implement?

I have a vps server on price.
by | 7 views

6 Answers

0 like 0 dislike
I use a bunch of "cron + mysqldump + dropbox" from the automated delivery of backup on my machine and backup storage in the cloud.
by
0 like 0 dislike
If such questions arise, it is worth a try
\rSypex Dumper.
He of course still beta, but works very stable. Able to run from the crown and to fill in the files on the FTP anywhere. Sending soap you can implement yourself)
by
0 like 0 dislike
by
0 like 0 dislike
Avoiding all the database in a loop and remove the dumps
\r
#!/bin/bash USER="root" PASSWORD="123123" mkdir /var/backup/database/`date +%F`; for DB in `mysql-u$USER-p$PASSWORD -N-e 'show databases' | awk '{print $1}"; do mysqldump --user=$USER --host=$HOST --password=$PASSWORD ${DB} | gzip > /var/backup/database/`date +%F`/${DB}.sql.gz; echo "${DB} Backup"; done done 
by
0 like 0 dislike
not aesthetically pleasing =) but... p.s. (true for small databases, lock tables locks base in the dump process)
bash script to add in cron:
\r
#!/bin/sh mysqldump -u -p --lock-tables --opt  > /sqldata/dump.sql cd /sqldata/ tar-zcvf sqldata.tgz,*.sql perl sendtoemail.pl 

The script requires the folder /sqldata, sendtoemail.pl is in /sqldata.
\r
the contents sendtoemail.pl requires MIME::Lite:
\r
#!/usr/bin/perl -w use MIME::Lite; $msg = MIME::Lite->new( From => 'backup@wailaowai.com', To => 'me@wailaowai.com', Subject => 'sqldata.tgz MySQL backup!', Type => 'text/plain', Data => "Here are the MySQL database backups."); $msg->attach(Type=>"application/x-tar", Path =>"/sqldata/sqldata.tgz", Filename =>"sqldata.tgz"); $msg->send; 
by
0 like 0 dislike
Can recommend as well AutoMySQLBackup.
To configure and hang in CZK. Can send dumps to email — setting MAILCONTENT="files" you need to get started mutt.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
asked Mar 22, 2019 by elisium
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
25,520 users