[Zodb-checkins] CVS: ZODB3/Tools - repozo.py:22.214.171.124
tim.one at comcast.net
Sat Aug 16 23:46:09 EDT 2003
Update of /cvs-repository/ZODB3/Tools
In directory cvs.zope.org:/tmp/cvs-serv10008/Tools
There wasn't enough info in the module docstring for me to figure out how
to use this script (what's required, what's optional, what are default
values if something isn't specified). Tried to repair that. Removed the
TODO list since the two items in it appear to be done already.
=== ZODB3/Tools/repozo.py 126.96.36.199 => 188.8.131.52 ===
--- ZODB3/Tools/repozo.py:184.108.40.206 Sat Aug 16 19:31:52 2003
+++ ZODB3/Tools/repozo.py Sat Aug 16 22:46:03 2003
@@ -4,61 +4,62 @@
# Originally written by Anthony Baxter
# Significantly modified by Barry Warsaw
-# allow gzipping of backup files.
-# allow backup files in subdirectories.
"""repozo.py -- incremental and full backups of a Data.fs file.
Usage: %(program)s [options]
+ Exactly one of -B or -R must be specified:
-B / --backup
- backup current ZODB file
+ Backup current ZODB file.
-R / --recover
- restore a ZODB file from a backup
+ Restore a ZODB file from a backup.
-v / --verbose
- Verbose mode
+ Verbose mode.
-h / --help
- Print this text and exit
+ Print this text and exit.
- Repository directory containing the backup files
+ Repository directory containing the backup files. This argument
+ is required.
-Flags for --backup:
+Options for -B/--backup:
- Source Data.fs file
+ Source Data.fs file. This argument is required.
-F / --full
- Force a full backup
+ Force a full backup. By default, an incremental backup is made
+ if possible (e.g., if a pack has occurred since the last
+ incremental backup, a full backup is necessary).
-Q / --quick
Verify via md5 checksum only the last incremental written. This
significantly reduces the disk i/o at the (theoretical) cost of
+ inconsistency. This is a probabilistic way of determining whether
+ a full backup is necessary.
-z / --gzip
Compress with gzip the backup files. Uses the default zlib
- compression level.
+ compression level. By default, gzip compression is not used.
-Flags for --recover:
+Options for -R/--recover:
- Recover state as at this date. str is in the format
- -o file
- Write recovered ZODB to given file. If not given, the file will be
+ Recover state as of this date. str is in the format
+ By default, current time is used.
+ -o filename
+ Write recovered ZODB to given file. By default, the file is
written to stdout.
-One of --backup or --recover is required.
from __future__ import nested_scopes
@@ -120,14 +121,14 @@
- mode = None
- file = None
- repository = None
- full = False
- date = None
- output = None
- quick = False
- gzip = False
+ mode = None # BACKUP or RECOVER
+ file = None # name of input Data.fs file
+ repository = None # name of directory holding backups
+ full = False # True forces full backup
+ date = None # -D argument, if any
+ output = None # where to write recovered data; None = stdout
+ quick = False # -Q flag state
+ gzip = False # -z flag state
options = Options()
@@ -158,6 +159,8 @@
options.output = arg
elif opt in ('-z', '--gzip'):
options.gzip = True
+ assert False, (opt, arg)
# Any other arguments are invalid
More information about the Zodb-checkins