[HOWTO] Make automatic backup of ALL MySQL / MariaSQL databases on QNAP V3.8
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.6
That might be a bug in the script, could you try changing the rights for the subfolders to 777?
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
-
- Starting out
- Posts: 12
- Joined: Sat Aug 23, 2014 12:23 am
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.6
Okay, I went ahead and used chmod on all the mysql folders in addition to the files, ran a backup manually and it still didn't clear anything. I did notice however, that every time I ran a manual backup, the script would overwrite the current days backup with the new backup, leading me to believe it may not permissions based, but possibly the code that does the compare and cleans out older backups.
I know you previously had to edit the script to account for shares with spaces in them, does the code that does the compare by chance need to be tweaked to account for that?
I know you previously had to edit the script to account for shares with spaces in them, does the code that does the compare by chance need to be tweaked to account for that?
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.6
Ahh, that might be it. I'd forgotten about that, I'll have a look at that asap.
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.6
Still working on this, the problem is in the handling of spaces in path, as you thought.
This works
This doesn't work
It has to do with the shell embedding with `
This works
Code: Select all
/bin/rm -f `/bin/ls -t $bkup_p/mysql.daily/* 2> /dev/null | /bin/awk 'NR>'5`
Code: Select all
/bin/rm -f `/bin/ls -t "$bkup_p/mysql.daily/*" 2> /dev/null | /bin/awk 'NR>'5`
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
Ok, got it solved, thanks to OneCD. Please test v3.7 of the script, I've done a lot of testing on the path thing, so it should be solid now.
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
-
- Starting out
- Posts: 14
- Joined: Mon Oct 21, 2013 9:07 pm
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
Runs fine for me.
There are only 2 typo's for deleting old weekly and monthly backups:
- Line 198: " $day_ret " has to be changed in " $week_ret "
- Line 204: " $day_ret " has to be changed in " $month_ret "
Thanks for your great work!
There are only 2 typo's for deleting old weekly and monthly backups:
Code: Select all
# # Delete old weekly backups
info "Cleaning out old backups. Keeping the last $week_ret week backups"
full="$bkup_p/mysql.weekly"
for target in $(ls -t "$full" | tail -n +$(expr $day_ret + 1)) ; do rm -f "$full/$target"; done
if [ $? != 0 ] ; then error "ereasing old weekly backups" ; fi
# Delete old monthly backups
info "Cleaning out old backups. Keeping the last $month_ret montly backups"
full="$bkup_p/mysql.monthly"
for target in $(ls -t "$full" | tail -n +$(expr $day_ret + 1)) ; do rm -f "$full/$target"; done
if [ $? != 0 ] ; then error "ereasing old montly backups" ; fi
- Line 198: " $day_ret " has to be changed in " $week_ret "
- Line 204: " $day_ret " has to be changed in " $month_ret "
Thanks for your great work!
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
Yup, just saw that as well, I'll update NOW
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
Script is fixed, darned
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
-
- Starting out
- Posts: 12
- Joined: Sat Aug 23, 2014 12:23 am
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
For some reason when I drop in the new script, it can no longer find my share name. Was something changed with how it finds the share?
Please see the attached screenshot.
Please see the attached screenshot.
You do not have the required permissions to view the files attached to this post.
-
- Starting out
- Posts: 12
- Joined: Sat Aug 23, 2014 12:23 am
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
I think I figured it out....I had to add quotes to $share in the following line:nevaeh wrote:For some reason when I drop in the new script, it can no longer find my share name. Was something changed with how it finds the share?
Please see the attached screenshot.
bkup_p=$($get_c "$share" path -f /etc/config/smb.conf)
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
I see, odd, I had it running here with spaces. I'll update the script right away, thankyou for the fix!
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
- fribse
- Experience counts
- Posts: 2090
- Joined: Mon Feb 11, 2008 2:50 am
- Location: Greve, Denmark
- Contact:
Re: [HOWTO] Make automatic backup of ALL MySQL databases V3.7
The script is updated now, there were a few more regression errors with quotes from when I cleaned it up. The lines handling if the 'mysql.*' folders are missing, also missed some quotes.
Best regards
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
Fribse
NO, RAID is NOT backup - Use RAID-Certified 24x7 drives for raid
HOWTO's:
Make automatic backup of ALL MySQL databases http://forum.qnap.com/viewtopic.php?f=32&t=15628
NAS-659 Pro II (3 GB Ram), Raid1, Survailance station, local backup destination + NAS-853A (16 GB Ram), Virtualization Station, Plex, iDrive
Network: Fritz!Box 7560 + 24p SG200 + 2x8p SG200 + 8p POE EdgeCore + 300/300 mbit Internet
-
- Starting out
- Posts: 12
- Joined: Sat Aug 23, 2014 12:23 am
Re: [HOWTO] Make automatic backup of ALL MySQL / MariaSQL databases on QNAP V3.7
Just wanted to say thank you for everything! It looks to be working perfectly now.
-
- Easy as a breeze
- Posts: 310
- Joined: Sun Nov 29, 2009 6:43 pm
- Location: Germany
Re: [HOWTO] Make automatic backup of ALL MySQL / MariaSQL databases on QNAP V3.7
Big thanks for that !!!
- GTunney
- Been there, done that
- Posts: 739
- Joined: Tue Oct 14, 2014 4:16 pm
Re: [HOWTO] Make automatic backup of ALL MySQL / MariaSQL databases on QNAP V3.7
Hi Fribse,
I'm trying to configure the mysql backup and have managed to get this to run manually via putty when I input the command and it runs absolutely fine.
How ever when I configure to run via cron I get an error when it tries to compress the database. any suggestions?
I'm trying to configure the mysql backup and have managed to get this to run manually via putty when I input the command and it runs absolutely fine.
How ever when I configure to run via cron I get an error when it tries to compress the database. any suggestions?
Model: TS-453D 8GB
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex | Sonarr | QSabnzbd+ | Radarr | Home Assistant | MQTT/Z2M
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTP - 1014/104 | Netgear GS108 Gigabit Switch
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex | Sonarr | QSabnzbd+ | Radarr | Home Assistant | MQTT/Z2M
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTP - 1014/104 | Netgear GS108 Gigabit Switch