mirror of
https://github.com/isar/libmdbx.git
synced 2025-07-13 00:14:45 +08:00
mdbx-tools: добавление опции -f
в утилиту mdbx_copy
.
This commit is contained in:
parent
4bb69a1c8f
commit
53c14bc92c
@ -14,6 +14,8 @@ mdbx_copy \- MDBX environment copy tool
|
|||||||
[\c
|
[\c
|
||||||
.BR \-c ]
|
.BR \-c ]
|
||||||
[\c
|
[\c
|
||||||
|
.BR \-f ]
|
||||||
|
[\c
|
||||||
.BR \-d ]
|
.BR \-d ]
|
||||||
[\c
|
[\c
|
||||||
.BR \-p ]
|
.BR \-p ]
|
||||||
@ -49,6 +51,9 @@ or unused pages will be omitted from the copy. This option will
|
|||||||
slow down the backup process as it is more CPU-intensive.
|
slow down the backup process as it is more CPU-intensive.
|
||||||
Currently it fails if the environment has suffered a page leak.
|
Currently it fails if the environment has suffered a page leak.
|
||||||
.TP
|
.TP
|
||||||
|
.BR \-f
|
||||||
|
Silently overwrite the target file, if it exists, instead of reaching an error.
|
||||||
|
.TP
|
||||||
.BR \-d
|
.BR \-d
|
||||||
Alters geometry to enforce the copy to be a dynamic size DB,
|
Alters geometry to enforce the copy to be a dynamic size DB,
|
||||||
which could be growth and shrink by reasonable steps on the fly.
|
which could be growth and shrink by reasonable steps on the fly.
|
||||||
|
@ -42,6 +42,7 @@ static void usage(const char *prog) {
|
|||||||
" -V\t\tprint version and exit\n"
|
" -V\t\tprint version and exit\n"
|
||||||
" -q\t\tbe quiet\n"
|
" -q\t\tbe quiet\n"
|
||||||
" -c\t\tenable compactification (skip unused pages)\n"
|
" -c\t\tenable compactification (skip unused pages)\n"
|
||||||
|
" -f\t\tforce copying even the target file exists\n"
|
||||||
" -d\t\tenforce copy to be a dynamic size DB\n"
|
" -d\t\tenforce copy to be a dynamic size DB\n"
|
||||||
" -p\t\tusing transaction parking/ousting during copying MVCC-snapshot\n"
|
" -p\t\tusing transaction parking/ousting during copying MVCC-snapshot\n"
|
||||||
" \t\tto avoid stopping recycling and overflowing the DB\n"
|
" \t\tto avoid stopping recycling and overflowing the DB\n"
|
||||||
@ -87,6 +88,8 @@ int main(int argc, char *argv[]) {
|
|||||||
cpflags |= MDBX_CP_FORCE_DYNAMIC_SIZE;
|
cpflags |= MDBX_CP_FORCE_DYNAMIC_SIZE;
|
||||||
else if (argv[1][1] == 'p' && argv[1][2] == '\0')
|
else if (argv[1][1] == 'p' && argv[1][2] == '\0')
|
||||||
cpflags |= MDBX_CP_THROTTLE_MVCC;
|
cpflags |= MDBX_CP_THROTTLE_MVCC;
|
||||||
|
else if (argv[1][1] == 'f' && argv[1][2] == '\0')
|
||||||
|
cpflags |= MDBX_CP_OVERWRITE;
|
||||||
else if (argv[1][1] == 'q' && argv[1][2] == '\0')
|
else if (argv[1][1] == 'q' && argv[1][2] == '\0')
|
||||||
quiet = true;
|
quiet = true;
|
||||||
else if (argv[1][1] == 'u' && argv[1][2] == '\0')
|
else if (argv[1][1] == 'u' && argv[1][2] == '\0')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user