It is currently Sat Jan 23, 2021 6:42 am
All times are UTC + 8 hours

mysql backup

Share your awesome tips and tricks here.

Re: mysql backup

Postby James.W@AST » Thu May 02, 2013 3:17 pm

by the way, mysqldump should be available since 1.0.9
To Infinity and Beyond!

Friends of My AS-606T: (RAID 5 with WD Black 2TB * 4, WD Red 2TB * 2)
MacBook Air (10.8) & Self-assembled Windows PC (Windows 7)
iPhone 4S (iOS 6) & iPad 2 (iOS 6)
Boxee Box, Logitech Squeezebox Duet
SONY HT-CT150 Sound Bar (Connected directly to the NAS via HDMI)
CISCO Linksys E4200
User avatar
James.W@AST
 
Posts: 189
Joined: Wed Jun 06, 2012 12:50 am

Re: mysql backup

Postby ho66es » Thu May 02, 2013 4:01 pm

James.W@AST wrote:by the way, mysqldump should be available since 1.0.9


nice work :)
608t
ho66es
 
Posts: 476
Joined: Wed Mar 13, 2013 5:38 am

Re: mysql backup

Postby atiras » Mon Oct 21, 2013 10:01 pm

I'm trying to use this script and testing it by executing it as root before I schedule it using cron. I get the following error:


Code: Select all
Backing up database performance_schema to /volume1/sqlbackup/mysql/performance_schema.sql\n
/volume1/sqlbackup/mysqlbackup.sh: line 74: /volume0/usr/builtin/sbin: Permission denied


The sql user and password exist and have all rights to all databases. (I've hard-coded these for now). I've also tried using no password and the root account for sql -- no joy.
The share sqlbackup exists and has RW access for everyone.

What else do I need to check?
atiras
 
Posts: 28
Joined: Wed Oct 02, 2013 6:37 pm

Re: mysql backup

Postby ho66es » Tue Oct 22, 2013 12:25 am

atiras wrote:I'm trying to use this script and testing it by executing it as root before I schedule it using cron. I get the following error:


Code: Select all
Backing up database performance_schema to /volume1/sqlbackup/mysql/performance_schema.sql\n
/volume1/sqlbackup/mysqlbackup.sh: line 74: /volume0/usr/builtin/sbin: Permission denied


The sql user and password exist and have all rights to all databases. (I've hard-coded these for now). I've also tried using no password and the root account for sql -- no joy.
The share sqlbackup exists and has RW access for everyone.

What else do I need to check?


there was a bug in the script, I have uploaded v1.1 please try this one
608t
ho66es
 
Posts: 476
Joined: Wed Mar 13, 2013 5:38 am

Re: mysql backup

Postby atiras » Tue Oct 22, 2013 12:43 am

Thank you -- that works.
atiras
 
Posts: 28
Joined: Wed Oct 02, 2013 6:37 pm

Re: mysql backup

Postby ho66es » Tue Oct 22, 2013 3:35 am

atiras wrote:Thank you -- that works.


glad to hear it is useful to someone :)
608t
ho66es
 
Posts: 476
Joined: Wed Mar 13, 2013 5:38 am

Re: mysql backup

Postby sksbir » Tue Sep 15, 2015 1:55 am

ho66es wrote:Ok this is the script I am using from cron

cron entry is

Code: Select all
# backup prep
10 1 * * * /volume1/misc/mysqlbackup.sh


this is designed to be run before my backups to remote location so that the database is fully backed up daily and previous backups are archived. The backup dumps each database to a separate sql file and is commented where your install may differ from mine (I run the script from a share called misc, the backups go to a share called backup and the password for the backup user is stored in a file /etc/backuppass the only contents of that file are the password.

*updated script*
mysqlbackup.zip


please feel free to read and get back to me with any ideas for changes / fixes. If you choose to try this please understand I make no guarantees other than it works for me and on my austor and I will not be responsible if it damages the contents of your nas in any way etc etc.


Hello
Two corrections to do : replace LOC_C by LOG_C 2 times.
sksbir
 
Posts: 339
Joined: Tue Aug 25, 2015 9:23 pm

Re: mysql backup

Postby Gunthor » Wed Oct 04, 2017 2:02 am

Thank you ho66es - What a wonderful and highly professional solution. I love the system log entries. Works like a charm. I messed up 70 data records in one of my MySql databases today - managed to recreate them with quite some time - and was just looking for an automatic solution for regular updates. Again: "Thank you for sharing..." :D :D :D
Asustor AS-604RS, ADM 3.1.2.RHG1 (4 x WD Red WD30EFRX 3TB, RAID 5)
User avatar
Gunthor
 
Posts: 107
Joined: Sun Jun 23, 2013 6:04 pm
Location: Germany - Stuttgart

Previous

Return to Tips & Tricks

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 3 guests