Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
f3af8536
Commit
f3af8536
authored
Sep 17, 2010
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repozo: Remove '.index' + files corresponding to backups being removed.
parent
da54ebd6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
12 deletions
+45
-12
src/CHANGES.txt
src/CHANGES.txt
+8
-4
src/ZODB/scripts/repozo.py
src/ZODB/scripts/repozo.py
+8
-1
src/ZODB/scripts/tests/test_repozo.py
src/ZODB/scripts/tests/test_repozo.py
+29
-7
No files found.
src/CHANGES.txt
View file @
f3af8536
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
Bugs fixed
Bugs fixed
----------
----------
- Updated the 'repozo --kill-old-on-full' option to remove any '.index'
files corresponding to backups being removed.
- When objects were added in savepoints and either the savepoint was
- When objects were added in savepoints and either the savepoint was
rolled back (https://bugs.launchpad.net/zodb/+bug/143560) or the
rolled back (https://bugs.launchpad.net/zodb/+bug/143560) or the
transaction was aborted
transaction was aborted
...
@@ -204,7 +207,7 @@ New Features
...
@@ -204,7 +207,7 @@ New Features
iterator implementations should just raise StopIteration, which
iterator implementations should just raise StopIteration, which
means they can now be implemented as generators.
means they can now be implemented as generators.
- The file-storage backup script, repoz
e
, will now create a backup
- The file-storage backup script, repoz
o
, will now create a backup
index file if an output file name is given via the --output/-o
index file if an output file name is given via the --output/-o
option.
option.
...
@@ -225,9 +228,10 @@ Bugs Fixed
...
@@ -225,9 +228,10 @@ Bugs Fixed
New Features
New Features
------------
------------
- Added a '--kill-old-on-full' argument to the backup options: if passed,
- Added a '--kill-old-on-full' argument to the repozo backup options:
remove any older full or incremental backup files from the repository after
if passed, remove any older full or incremental backup files from the
doing a full backup. (https://bugs.launchpad.net/zope2/+bug/143158)
repository after doing a full backup.
(https://bugs.launchpad.net/zope2/+bug/143158)
- When transactions are aborted, new object ids allocated during the
- When transactions are aborted, new object ids allocated during the
transaction are saved and used in subsequent transactions. This can
transaction are saved and used in subsequent transactions. This can
...
...
src/ZODB/scripts/repozo.py
View file @
f3af8536
...
@@ -410,14 +410,21 @@ def delete_old_backups(options):
...
@@ -410,14 +410,21 @@ def delete_old_backups(options):
dat
=
root
+
'.dat'
dat
=
root
+
'.dat'
if
dat
in
deletable
:
if
dat
in
deletable
:
deletable
.
remove
(
dat
)
deletable
.
remove
(
dat
)
index
=
root
+
'.index'
if
index
in
deletable
:
deletable
.
remove
(
index
)
for
fname
in
deletable
:
for
fname
in
deletable
:
log
(
'removing old backup file %s (and .dat)'
,
fname
)
log
(
'removing old backup file %s (and .dat
/ .index
)'
,
fname
)
root
,
ext
=
os
.
path
.
splitext
(
fname
)
root
,
ext
=
os
.
path
.
splitext
(
fname
)
try
:
try
:
os
.
unlink
(
os
.
path
.
join
(
options
.
repository
,
root
+
'.dat'
))
os
.
unlink
(
os
.
path
.
join
(
options
.
repository
,
root
+
'.dat'
))
except
OSError
:
except
OSError
:
pass
pass
try
:
os
.
unlink
(
os
.
path
.
join
(
options
.
repository
,
root
+
'.index'
))
except
OSError
:
pass
os
.
unlink
(
os
.
path
.
join
(
options
.
repository
,
fname
))
os
.
unlink
(
os
.
path
.
join
(
options
.
repository
,
fname
))
def
do_full_backup
(
options
):
def
do_full_backup
(
options
):
...
...
src/ZODB/scripts/tests/test_repozo.py
View file @
f3af8536
...
@@ -457,7 +457,10 @@ class Test_delete_old_backups(OptionsTestBase, unittest.TestCase):
...
@@ -457,7 +457,10 @@ class Test_delete_old_backups(OptionsTestBase, unittest.TestCase):
self
.
failUnless
(
os
.
path
.
isfile
(
fqn
))
self
.
failUnless
(
os
.
path
.
isfile
(
fqn
))
def
test_doesnt_remove_current_repozo_files
(
self
):
def
test_doesnt_remove_current_repozo_files
(
self
):
FILENAMES
=
[
'2009-12-20-10-08-03.fs'
,
'2009-12-20-10-08-03.dat'
]
FILENAMES
=
[
'2009-12-20-10-08-03.fs'
,
'2009-12-20-10-08-03.dat'
,
'2009-12-20-10-08-03.index'
,
]
self
.
_callFUT
(
filenames
=
FILENAMES
)
self
.
_callFUT
(
filenames
=
FILENAMES
)
remaining
=
os
.
listdir
(
self
.
_repository_directory
)
remaining
=
os
.
listdir
(
self
.
_repository_directory
)
self
.
assertEqual
(
len
(
remaining
),
len
(
FILENAMES
))
self
.
assertEqual
(
len
(
remaining
),
len
(
FILENAMES
))
...
@@ -466,9 +469,19 @@ class Test_delete_old_backups(OptionsTestBase, unittest.TestCase):
...
@@ -466,9 +469,19 @@ class Test_delete_old_backups(OptionsTestBase, unittest.TestCase):
self
.
failUnless
(
os
.
path
.
isfile
(
fqn
))
self
.
failUnless
(
os
.
path
.
isfile
(
fqn
))
def
test_removes_older_repozo_files
(
self
):
def
test_removes_older_repozo_files
(
self
):
OLDER_FULL
=
[
'2009-12-20-00-01-03.fs'
,
'2009-12-20-00-01-03.dat'
]
OLDER_FULL
=
[
'2009-12-20-00-01-03.fs'
,
DELTAS
=
[
'2009-12-21-00-00-01.deltafs'
,
'2009-12-22-00-00-01.deltafs'
]
'2009-12-20-00-01-03.dat'
,
CURRENT_FULL
=
[
'2009-12-23-00-00-01.fs'
,
'2009-12-23-00-00-01.dat'
]
'2009-12-20-00-01-03.index'
,
]
DELTAS
=
[
'2009-12-21-00-00-01.deltafs'
,
'2009-12-21-00-00-01.index'
,
'2009-12-22-00-00-01.deltafs'
,
'2009-12-22-00-00-01.index'
,
]
CURRENT_FULL
=
[
'2009-12-23-00-00-01.fs'
,
'2009-12-23-00-00-01.dat'
,
'2009-12-23-00-00-01.index'
,
]
FILENAMES
=
OLDER_FULL
+
DELTAS
+
CURRENT_FULL
FILENAMES
=
OLDER_FULL
+
DELTAS
+
CURRENT_FULL
self
.
_callFUT
(
filenames
=
FILENAMES
)
self
.
_callFUT
(
filenames
=
FILENAMES
)
remaining
=
os
.
listdir
(
self
.
_repository_directory
)
remaining
=
os
.
listdir
(
self
.
_repository_directory
)
...
@@ -484,10 +497,19 @@ class Test_delete_old_backups(OptionsTestBase, unittest.TestCase):
...
@@ -484,10 +497,19 @@ class Test_delete_old_backups(OptionsTestBase, unittest.TestCase):
self
.
failUnless
(
os
.
path
.
isfile
(
fqn
))
self
.
failUnless
(
os
.
path
.
isfile
(
fqn
))
def
test_removes_older_repozo_files_zipped
(
self
):
def
test_removes_older_repozo_files_zipped
(
self
):
OLDER_FULL
=
[
'2009-12-20-00-01-03.fsz'
,
'2009-12-20-00-01-03.dat'
]
OLDER_FULL
=
[
'2009-12-20-00-01-03.fsz'
,
'2009-12-20-00-01-03.dat'
,
'2009-12-20-00-01-03.index'
,
]
DELTAS
=
[
'2009-12-21-00-00-01.deltafsz'
,
DELTAS
=
[
'2009-12-21-00-00-01.deltafsz'
,
'2009-12-22-00-00-01.deltafsz'
]
'2009-12-21-00-00-01.index'
,
CURRENT_FULL
=
[
'2009-12-23-00-00-01.fsz'
,
'2009-12-23-00-00-01.dat'
]
'2009-12-22-00-00-01.deltafsz'
,
'2009-12-22-00-00-01.index'
,
]
CURRENT_FULL
=
[
'2009-12-23-00-00-01.fsz'
,
'2009-12-23-00-00-01.dat'
,
'2009-12-23-00-00-01.index'
,
]
FILENAMES
=
OLDER_FULL
+
DELTAS
+
CURRENT_FULL
FILENAMES
=
OLDER_FULL
+
DELTAS
+
CURRENT_FULL
self
.
_callFUT
(
filenames
=
FILENAMES
)
self
.
_callFUT
(
filenames
=
FILENAMES
)
remaining
=
os
.
listdir
(
self
.
_repository_directory
)
remaining
=
os
.
listdir
(
self
.
_repository_directory
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment