Re: [ZODB-Dev] repozo delete_old_backups

2010-09-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

DJL wrote:
> repozo delete_old_backups does not delete old index files

Thanks for noticing this issue.  I have updated the script and tests to
cover this case on the trunk.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkyTbGQACgkQ+gerLs4ltQ5kzQCeIrktIiJc7zaiXjfoNtItyqjX
oM8AoL0+Lq7IhNb6KpeD0/6Zhz8KM1IH
=at14
-END PGP SIGNATURE-

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] repozo delete_old_backups

2010-09-17 Thread DJL
sugest to add the lines like this:

def delete_old_backups(options):
# Delete all full backup files except for the most recent full
backup file
all = filter(is_data_file, os.listdir(options.repository))
all.sort()

deletable = []
full = []
for fname in all:
root, ext = os.path.splitext(fname)
if ext in ('.fs', '.fsz'):
full.append(fname)
if ext in ('.fs', '.fsz', '.deltafs', '.deltafsz'):
deletable.append(fname)

# keep most recent full
if not full:
return

recentfull = full.pop(-1)
deletable.remove(recentfull)
root, ext = os.path.splitext(recentfull)

dat = root + '.dat'
if dat in deletable:
deletable.remove(dat)

+   ind = root + '.index'
+   if ind in deletable:
+   deletable.remove(ind)

for fname in deletable:
log('removing old backup file %s (and .dat)', fname)
root, ext = os.path.splitext(fname)
try:
os.unlink(os.path.join(options.repository, root + '.dat'))
+   os.unlink(os.path.join(options.repository, root + '.index'))
except OSError:
pass
        os.unlink(os.path.join(options.repository, fname))

 Original Message  
Subject: [ZODB-Dev] repozo delete_old_backups
From: DJL 
To: zodb-dev 
Date: 09/17/2010 01:04 PM
> repozo delete_old_backups does not delete old index files
>
>
> ___
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list  -  ZODB-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zodb-dev
>
>
>
>   


___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] repozo delete_old_backups

2010-09-17 Thread DJL
repozo delete_old_backups does not delete old index files


___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev