Thread: [Automysqlbackup-users] Weekly backups not being rotated?
Automatic MySQL Backup
Brought to you by:
wipe_out
From: Russell J. <rj...@eg...> - 2009-07-22 01:03:35
|
I have a separate script that runs to zip up my weekly backups and move them to a separate place. However I noticed that this file seemed to be getting a little large. Upon inpsection I noticed that the weekly folder held several months worth of backups. Here is one database's folder within the weekly folder: -r-------- 1 root root 104173 May 2 04:02 mysql_week.18.2009-05-02_04h02m.sql.gz -r-------- 1 root root 104169 May 9 04:02 mysql_week.19.2009-05-09_04h02m.sql.gz -r-------- 1 root root 104169 May 16 04:02 mysql_week.20.2009-05-16_04h02m.sql.gz -r-------- 1 root root 104272 May 23 04:02 mysql_week.21.2009-05-23_04h02m.sql.gz -r-------- 1 root root 104272 May 30 04:02 mysql_week.22.2009-05-30_04h02m.sql.gz -r-------- 1 root root 104271 Jun 6 04:02 mysql_week.23.2009-06-06_04h02m.sql.gz -r-------- 1 root root 104272 Jun 13 04:02 mysql_week.24.2009-06-13_04h02m.sql.gz -r-------- 1 root root 104272 Jun 20 04:02 mysql_week.25.2009-06-20_04h02m.sql.gz -r-------- 1 root root 104272 Jun 27 04:02 mysql_week.26.2009-06-27_04h02m.sql.gz -r-------- 1 root root 104272 Jul 4 04:02 mysql_week.27.2009-07-04_04h02m.sql.gz -r-------- 1 root root 104271 Jul 11 04:02 mysql_week.28.2009-07-11_04h02m.sql.gz -r-------- 1 root root 104274 Jul 18 04:02 mysql_week.29.2009-07-18_04h02m.sql.gz I was under the impression that the weekly folder would hold only 5 weeks worth of backups. Per under the Backup Rotation section: # Weekly Backups are rotated on a 5 week cycle.. Am I not understanding something correctly, or is there an error I am encountering? Thanks! |
From: Adrian S. <ad...@pe...> - 2009-07-22 09:36:58
|
On 22 Jul 2009, at 01:43, Russell Jones wrote: > Am I not understanding something correctly, or is there an error I am > encountering? Looks like I have the same problem, also for monthly, there's backups in both going back to 2007 on some of my sites. My first thought was a permissions problem, but they seem to be identical for both daily, weekly and monthly. Off to look through the script see, if there's anything obvious. Adrian -- Phone: +44 1382 541 586 or +44 131 208 0840 e-mail <mailto:ad...@pe...> AOL/Yahoo/Skype/Gizmo ID: perlucida Web Site <http://perlucida.com> |
From: WipeOut <wip...@us...> - 2009-07-22 10:07:54
|
Adrian Simmons wrote: > On 22 Jul 2009, at 01:43, Russell Jones wrote: > >> Am I not understanding something correctly, or is there an error I am >> encountering? > Looks like I have the same problem, also for monthly, there's backups > in both going back to 2007 on some of my sites. > My first thought was a permissions problem, but they seem to be > identical for both daily, weekly and monthly. > > Off to look through the script see, if there's anything obvious. > > Adrian I am currently testing an updated version with a patch applied to fix the weekly rotation but and also updates the way the daily archive is maintained.. If all goes well I will post it in the next week or two.. |
From: Adrian S. <ad...@pe...> - 2009-07-22 10:18:52
|
On 22 Jul 2009, at 10:46, WipeOut wrote: > I am currently testing an updated version with a patch applied to fix > the weekly rotation but and also updates the way the daily archive is > maintained.. If all goes well I will post it in the next week or two.. Yeah, I just found the issue for this, if anyone needs this now, there is a patch: http://sourceforge.net/tracker/?func=detail&aid=1575311&group_id=101066&atid=628964 Ignore my last email about the change to line 539, this patch does it properly. Adrian -- Phone: +44 1382 541 586 or +44 131 208 0840 e-mail <mailto:ad...@pe...> AOL/Yahoo/Skype/Gizmo ID: perlucida Web Site <http://perlucida.com> |
From: WipeOut <wip...@us...> - 2009-07-22 10:24:16
|
Adrian Simmons wrote: > On 22 Jul 2009, at 10:46, WipeOut wrote: >> I am currently testing an updated version with a patch applied to fix >> the weekly rotation but and also updates the way the daily archive is >> maintained.. If all goes well I will post it in the next week or two.. > > Yeah, I just found the issue for this, if anyone needs this now, there > is a patch: > http://sourceforge.net/tracker/?func=detail&aid=1575311&group_id=101066&atid=628964 > > Ignore my last email about the change to line 539, this patch does it > properly. > > Adrian That is another way to resolve it as well.. :) |
From: Russell J. <rj...@eg...> - 2009-07-22 13:55:44
|
I am already using version 2.5. I applied the change to line 539. Hopefully this will fix it. Thanks! WipeOut wrote: > Adrian Simmons wrote: > >> On 22 Jul 2009, at 10:46, WipeOut wrote: >> >>> I am currently testing an updated version with a patch applied to fix >>> the weekly rotation but and also updates the way the daily archive is >>> maintained.. If all goes well I will post it in the next week or two.. >>> >> Yeah, I just found the issue for this, if anyone needs this now, there >> is a patch: >> http://sourceforge.net/tracker/?func=detail&aid=1575311&group_id=101066&atid=628964 >> >> Ignore my last email about the change to line 539, this patch does it >> properly. >> >> Adrian >> > > That is another way to resolve it as well.. :) > > ------------------------------------------------------------------------------ > _______________________________________________ > Automysqlbackup-users mailing list > Aut...@li... > https://lists.sourceforge.net/lists/listinfo/automysqlbackup-users > |
From: Adrian S. <ad...@pe...> - 2009-07-22 10:06:14
|
On 22 Jul 2009, at 01:43, Russell Jones wrote: > Am I not understanding something correctly, or is there an error I am > encountering? You do have 2.5? # VER 2.4 - (2006-01-23) # Fixed bug where weekly backups were not being rotated. (Fix by wolf02) I have 2.5 and have the same problem, but it's worth checking I guess. There are some differences between the routines used for rotating weekly backup depending on whether you use a separate directory for each db or whether all db's are in one. I use the separate directory setting, I think there is a bug with that... At line 539: eval rm -fv "$BACKUPDIR/weekly/$DB_week.$REMW.*" ought to be: eval rm -fv "$BACKUPDIR/weekly/${DB}_week.$REMW.*" Because in the former the variable name will be $DB_week. which doesn't exist, rather than $DB which is the db name being used. I'll give this change a shot. But I'm a shell scripting noob so use it at your own risk! Adrian -- Phone: +44 1382 541 586 or +44 131 208 0840 e-mail <mailto:ad...@pe...> AOL/Yahoo/Skype/Gizmo ID: perlucida Web Site <http://perlucida.com> |
From: WipeOut <wip...@us...> - 2009-07-22 10:22:50
|
Adrian Simmons wrote: > On 22 Jul 2009, at 01:43, Russell Jones wrote: >> Am I not understanding something correctly, or is there an error I am >> encountering? > You do have 2.5? > # VER 2.4 - (2006-01-23) > # Fixed bug where weekly backups were not being rotated. (Fix by > wolf02) > > I have 2.5 and have the same problem, but it's worth checking I guess. > > There are some differences between the routines used for rotating > weekly backup depending on whether you use a separate directory for > each db or whether all db's are in one. I use the separate directory > setting, I think there is a bug with that... > > At line 539: > > eval rm -fv "$BACKUPDIR/weekly/$DB_week.$REMW.*" > > ought to be: > > eval rm -fv "$BACKUPDIR/weekly/${DB}_week.$REMW.*" > > Because in the former the variable name will be $DB_week. which > doesn't exist, rather than $DB which is the db name being used. I'll > give this change a shot. But I'm a shell scripting noob so use it at > your own risk! > > Adrian The updated version will use "find" and delete all files older than a specified number of days.. Should simplify the existing logic and clean up everything.. :) |