15.5. Repository Administration: svnadmin

 < Day Day Up > 

svnadmin is the administrative tool for monitoring and repairing your Subversion repository.

15.5.1. svnadmin Options


--bdb-log-keep

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


--bdb-txn-nosync

Disable use of fsync( ) when committing database transactions. (Berkeley DB-specific)


--bypass-hooks

Bypass the repository hook system.


--clean-logs

Remove unused Berkeley DB logs.


--force-uuid

By default, when loading data into a repository that already contains revisions, svnadmin ignores the UUID from the dump stream. This option causes the repository's UUID to be set to the UUID from the stream.


--ignore-uuid

By default, when loading an empty repository, svnadmin uses the UUID from the dump stream. This option causes that UUID to be ignored.


--incremental

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


--parent-dir dir

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


--quiet

Do not show normal progress show only errors.


--revision rev, -r rev

Specify a particular revision to operate on.

15.5.2. svnadmin Subcommands

The svnadmin command creates and administers the repository. As such, it always operates on local paths, not on URLs.

create

 svnadmin create repos_path

Create a new, empty repository at the path provided. If the provided directory does not exist, it is created for you.

Options

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

Example

Creating a new repository is just this easy:

     $ svnadmin create /usr/local/svn/repos

deltify

 svnadmin deltify [-r lower[:upper]] repos_path

svnadmin deltify exists in 1.0.x only 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.

Options

--quiet
--revision rev, -r rev
dump

 svnadmin dump repos_path [-r lower[:upper]] [--incremental]

Dump the contents of filesystem to standard output in a "dumpfile" portable format, sending feedback to standard error. 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.

Options

--incremental
--quiet
--revision rev, -r rev

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     ...

help

 svnadmin help [subcommand ...]

Provide a quick usage summary. With subcommand, provide information about the given subcommand.

Alternate Names:

?, h


hotcopy

 svnadmin hotcopy old_repos_path new_repos_path

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 option, svnadmin performs a hotcopy of your repository, and then removes unused Berkeley DB logs from the original repository. You can run this command at any time and make a safe copy of the repository, regardless of whether other processes are using the repository.

Options

--clean-logs
list-dblogs

 svnadmin list-dblogs repos_path

List Berkeley DB log files. Berkeley DB creates logs of all changes to the repository, allowing the repository 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.

list-unused-dblogs

 svnadmin list-unused-dblogs repos_path

List unused Berkeley DB log files (see svnadmin list-dblogs).

Example

Remove all unused log files from a repository:

     $ svnadmin   list-unused-dblogs /path/to/repos | xargs rm     ## disk space reclaimed!

load

     svnadmin load repos_path

Read a "dumpfile"-formatted stream from standard input, committing new revisions into the repository's filesystem. Send progress feedback to standard output.

Options

--force-uuid

--parent-dir

--ignore-uuid

--quiet (-q)


Examples

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, 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.     ...

lstxns

 svnadmin lstxns repos_path

Print the names of all uncommitted transactions.

recover

 svnadmin recover repos_path

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

rmtxns

 svnadmin rmtxns repos_path txn_name ...

Delete outstanding transactions from a repository.

Options

--quiet (-q)

Examples

Remove all uncommitted transactions from your repository, using svn lstxns to provide the list of transactions to remove:

     $ svnadmin rmtxns /usr/local/svn/repos/ \     >          'svnadmin lstxns /usr/local/svn/repos/'

setlog

 svnadmin setlog repos_path -r revision file

Set the log message on revision revision to the contents of file.

This is similar to using svn propset --revprop to set the svn:log property on a revision, except 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 permanently overwrites the previous log message.


Options

--bypass-hooks
--revision rev, -r rev

Example

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

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

verify

 svnadmin verify repos_path

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

     < Day Day Up > 


    Unix in a Nutshell
    Unix in a Nutshell, Fourth Edition
    ISBN: 0596100299
    EAN: 2147483647
    Year: 2005
    Pages: 201

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