9.2 svnadmin

svnadmin is the administrative tool for monitoring and repairing your Subversion repository. For detailed information, see Section 5.3.1.2.

Since svnadmin works via direct repository access (and thus can only be used on the machine that holds the repository), it refers to the repository with a path, not a URL.

9.2.1 svnadmin Switches


--bdb-log-keep

(Berkeley DB specific) Disable automatic log removal of database log files.


--bdb-txn-nosync

(Berkeley DB specific) Disables fsync when committing database transactions.


--bypass-hooks

Bypass the repository hook system.


--clean-logs

Removes unused Berkeley DB logs.


--force-uuid

By default, when loading data into repository that already contains revisions, svnadmin will ignore the UUID from the dump stream. This switch will cause the repository's UUID to be set to the UUID from the stream.


--ignore-uuid

By default, when loading an empty repository, svnadmin will use the UUID from the dump stream. This switch will cause that UUID to be ignored.


--incremental

Dump a revision only as a diff against the previous revision, instead of the usual fulltext.


--parent-dir DIR

When loading a dumpfile, root paths at DIR instead of /.


--revision (-r ) ARG

Specify a particular revision to operate on.


--quiet

Do not show normal progress show only errors.

9.2.2 svnadmin Subcommands

svnadmin createCreates a new empty repository at REPOS_PATH.

Synopsis

svnadmin create REPOS_PATH

Description

Creates a new empty repository at the path provided. If the provided directory does not exist, it will be created for you (svnadmin works only with local paths, not URLs).

Switches

--bdb-txn-nosync --bdb-log-keep

Examples

Creating a new repository is just this easy:

$ svnadmin create /usr/local/svn/repos

svnadmin deltifyDeltify changed paths in a revision range.

Synopsis

svnadmin deltify [-r LOWER[:UPPER]] REPOS_PATH

Description

svnadmin deltify only exists in 1.0.x due to historical reasons. This command is deprecated and no longer needed.

It dates from a time when Subversion offered administrators greater control over compression strategies in the repository. This turned out to be a lot of complexity for very little gain, and this feature was deprecated.

Switches

--revision (-r) --quiet

svnadmin dumpDumps the contents of filesystem to stdout.

Synopsis

svnadmin dump REPOS_PATH [-r LOWER[:UPPER]] [--incremental]

Description

Dumps the contents of filesystem to stdout in a dumpfile portable format, sending feedback to stderr. Dump revisions LOWER rev through UPPER rev. If no revisions are given, dump all revision trees. If only LOWER is given, dump that one revision tree. See Section 5.3.5 for a practical use.

Switches

--revision (-r) --incremental --quiet

Examples

Dump your whole repository:

$ svnadmin dump /usr/local/svn/repos SVN-fs-dump-format-version: 1 Revision-number: 0 * Dumped revision 0. Prop-content-length: 56 Content-length: 56 ...

Incrementally dump a single transaction from your repository:

$ svnadmin dump /usr/local/svn/repos -r 21 --incremental  * Dumped revision 21. SVN-fs-dump-format-version: 1 Revision-number: 21 Prop-content-length: 101 Content-length: 101 ...

svnadmin helpShows documentation for the commands.

Synopsis

svnadmin help [SUBCOMMAND...]

Description

This subcommand is useful when you're trapped on a desert island with neither a net connection nor a copy of this book.

Alternate Names

?, h

svnadmin hotcopyMakes a hot copy of a repository.

Synopsis

svnadmin hotcopy OLD_REPOS_PATH NEW_REPOS_PATH

Description

This subcommand makes a full hot backup of your repository, including all hooks, configuration files, and, of course, database files. If you pass the --clean-logs switch, svnadmin will perform a hotcopy of your repository, and then remove unused Berkeley DB logs from the original repository.

Switches

--clean-logs

svnadmin list-dblogsAsks Berkeley DB which log files exist for a given svn repository.

Synopsis

svnadmin list-dblogs REPOS_PATH

Description

Berkeley DB creates logs of all changes to the repository, which allow it to recover in the face of catastrophe. Unless you enable DB_LOGS_AUTOREMOVE, the log files accumulate, although most are no longer used and can be deleted to reclaim disk space. See Section 5.3.3 for more information.

svnadmin list-unused-dblogsAsks Berkeley DB which log files can be safely deleted.

Synopsis

svnadmin list-unused-dblogs REPOS_PATH

Description

Berkeley DB creates logs of all changes to the repository, which allow it to recover in the face of catastrophe. Unless you enable DB_LOGS_AUTOREMOVE, the log files accumulate, although most are no longer used and can be deleted to reclaim disk space. See Section 5.3.3 for more information.

Examples

Remove all unused log files from a repository:

$ svnadmin list-unused-dblogs /path/to/repos /path/to/repos/log.0000000031 /path/to/repos/log.0000000032 /path/to/repos/log.0000000033 $ svnadmin list-unused-dblogs /path/to/repos | xargs rm ## disk space reclaimed!

svnadmin loadReads a dumpfile-formatted stream from stdin.

Synopsis

svnadmin load REPOS_PATH

Description

Reads a dumpfile-formatted stream from stdin, committing new revisions into the repository's filesystem. Send progress feedback to stdout.

Switches

--quiet (-q) --ignore-uuid --force-uuid --parent-dir

Example

This shows the beginning of loading a repository from a backup file (made, of course, with svn dump):

$ svnadmin load /usr/local/svn/restored < repos-backup <<< Started new txn, based on original revision 1      * adding path : test ... done.      * adding path : test/a ... done. ...

Or if you want to load into a subdirectory:

$ svnadmin load --parent-dir new/subdir/for/project /usr/local/svn/restored < repos- backup <<< Started new txn, based on original revision 1      * adding path : test ... done.      * adding path : test/a ... done. ...

svnadmin lstxnsPrints the names of all uncommitted transactions.

Synopsis

svnadmin lstxns REPOS_PATH

Description

Prints the names of all uncommitted transactions. See Section 5.3.2 for information on how uncommitted transactions are created and what you should do with them.

Examples

List all outstanding transactions in a repository:

$ svnadmin lstxns /usr/local/svn/repos/  1w 1x

svnadmin recoverRecovers any lost state in a repository.

Synopsis

svnadmin recover REPOS_PATH

Description

Run this command if you get an error indicating that your repository needs to be recovered.

Examples

Recover a hung repository:

$ svnadmin recover /usr/local/svn/repos/  Acquiring exclusive lock on repository db. Recovery is running, please stand by... Recovery completed. The latest repos revision is 34.

svnadmin rmtxnsDeletes transactions from a repository.

Synopsis

svnadmin rmtxns REPOS_PATH TXN_NAME...

Description

Deletes outstanding transactions from a repository. This is covered in detail in Section 5.3.2.

Switches

--quiet (-q)

Examples

Remove named transactions:

$ svnadmin rmtxns /usr/local/svn/repos/ 1w 1x

Fortunately, the output of svn lstxns works great as the input for rmtxns:

$ svnadmin rmtxns /usr/local/svn/repos/  `svnadmin lstxns /usr/local/svn/repos/`

This will remove all uncommitted transactions from your repository.

svnadmin setlogSets the log message on a revision.

Synopsis

svnadmin setlog REPOS_PATH -r REVISION FILE

Description

Sets the log message on revision REVISION to the contents of FILE.

Similar to using svn propset revprop to set the svn:log property on a revision, except that you can also use the option --bypass-hooks to avoid running any pre- or post-commit hooks, which is useful if the modification of revision properties has not been enabled in the pre-revprop-change hook.

Revision properties are not under version control, so this command will permanently overwrite the previous log message.


Switches

--revision (-r) ARG --bypass-hooks

Examples

Set the log message for revision 19 to the contents of the file msg:

$ svnadmin setlog /usr/local/svn/repos/ -r 19 msg

svnadmin verifyVerifies the data stored in the repository.

Synopsis

svnadmin verify REPOS_PATH

Description

Run this command if you wish to verify the integrity of your repository. This basically iterates through all revisions in the repository by internally dumping all revisions and discarding the output.

Examples

Verify a hung repository:

$ svnadmin verify /usr/local/svn/repos/  * Verified revision 1729.



Version Control with Subversion
Version Control with Subversion
ISBN: 0596510330
EAN: 2147483647
Year: 2003
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net