mysql backup
Moderator: Lillian.W@AST
-
- Posts: 476
- youtube meble na wymiar Warszawa
- Joined: Wed Mar 13, 2013 5:38 am
mysql backup
Hi I want to do a daily backup of the databases in mysql. I would prefer a script and crontab entry.
Does anyone have such a script before I try to reinvent the wheel?
Does anyone have such a script before I try to reinvent the wheel?
608t
-
- Posts: 476
- Joined: Wed Mar 13, 2013 5:38 am
Re: mysql backup
ok started looking at writing my own script but most seem to use mysqldump and I can't find it? can we get a version to use?
608t
- James.W@AST
- Posts: 189
- Joined: Wed Jun 06, 2012 12:50 am
Re: mysql backup
Hi ho66es,
Sure, we will put mysqldump in the next minor release (1.0.9) which should be released very soon.
or if you would like to give it a try in advance, you can download the attached file, unzip and save it to /volume0/usr/builtin/sbin/
JW
Sure, we will put mysqldump in the next minor release (1.0.9) which should be released very soon.
or if you would like to give it a try in advance, you can download the attached file, unzip and save it to /volume0/usr/builtin/sbin/
JW
- Attachments
-
- mysqldump.zip
- (769.21 KiB) Downloaded 844 times
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
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
-
- Posts: 476
- Joined: Wed Mar 13, 2013 5:38 am
Re: mysql backup
what a hero! many thanks.James.W@AST wrote:Hi ho66es,
Sure, we will put mysqldump in the next minor release (1.0.9) which should be released very soon.
or if you would like to give it a try in advance, you can download the attached file, unzip and save it to /volume0/usr/builtin/sbin/
JW
608t
- James.W@AST
- Posts: 189
- Joined: Wed Jun 06, 2012 12:50 am
Re: mysql backup
You are welcome, feel free to let me know if it works for you, okay?
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
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
-
- Posts: 476
- Joined: Wed Mar 13, 2013 5:38 am
Re: mysql backup
it works 1st script runs and creates backup, now to tweakJames.W@AST wrote:You are welcome, feel free to let me know if it works for you, okay?
608t
- James.W@AST
- Posts: 189
- Joined: Wed Jun 06, 2012 12:50 am
Re: mysql backup
Thanks for the update!
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
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
-
- Posts: 476
- Joined: Wed Mar 13, 2013 5:38 am
Re: mysql backup
now logging to system log , archiving old backups and dumping each database to its own sql file.
Also running from cron daily.
Also running from cron daily.
608t
-
- Posts: 476
- Joined: Wed Mar 13, 2013 5:38 am
Re: mysql backup
Ok this is the script I am using from cron
cron entry is
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* 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.
cron entry is
Code: Select all
# backup prep
10 1 * * * /volume1/misc/mysqlbackup.sh
*updated script* 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.
Last edited by ho66es on Tue Oct 22, 2013 12:25 am, edited 1 time in total.
608t
-
- Posts: 476
- Joined: Wed Mar 13, 2013 5:38 am
Re: mysql backup
/etc/backuppass is lost after reboot so i thought I would test startup scripts instead of moving to a different location
so I created a script called S75mysqlbackup under /usr/local/etc/init.d/ and for the contents inserted
where password is you chosen password
then make the script executable and it recreates the backup password file on reboot (theres easier ways to do this but I wanted to test startup scripts )
so I created a script called S75mysqlbackup under /usr/local/etc/init.d/ and for the contents inserted
Code: Select all
echo -e "password" >> /etc/backuppass
then make the script executable and it recreates the backup password file on reboot (theres easier ways to do this but I wanted to test startup scripts )
608t