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
9.2.2 svnadmin Subcommands
Synopsissvnadmin create REPOS_PATH DescriptionCreates 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 ExamplesCreating a new repository is just this easy: $ svnadmin create /usr/local/svn/repos
Synopsissvnadmin deltify [-r LOWER[:UPPER]] REPOS_PATH Descriptionsvnadmin 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
Synopsissvnadmin dump REPOS_PATH [-r LOWER[:UPPER]] [--incremental] DescriptionDumps 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 ExamplesDump 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 ...
Synopsissvnadmin help [SUBCOMMAND...] DescriptionThis 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
Synopsissvnadmin hotcopy OLD_REPOS_PATH NEW_REPOS_PATH DescriptionThis 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
Synopsissvnadmin list-dblogs REPOS_PATH DescriptionBerkeley 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.
Synopsissvnadmin list-unused-dblogs REPOS_PATH DescriptionBerkeley 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. ExamplesRemove 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!
Synopsissvnadmin load REPOS_PATH DescriptionReads 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 ExampleThis 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. ...
Synopsissvnadmin lstxns REPOS_PATH DescriptionPrints 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. ExamplesList all outstanding transactions in a repository: $ svnadmin lstxns /usr/local/svn/repos/ 1w 1x
Synopsissvnadmin recover REPOS_PATH DescriptionRun this command if you get an error indicating that your repository needs to be recovered. ExamplesRecover 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.
Synopsissvnadmin rmtxns REPOS_PATH TXN_NAME... DescriptionDeletes outstanding transactions from a repository. This is covered in detail in Section 5.3.2. Switches--quiet (-q) ExamplesRemove 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.
Synopsissvnadmin setlog REPOS_PATH -r REVISION FILE DescriptionSets 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.
Switches--revision (-r) ARG --bypass-hooks ExamplesSet the log message for revision 19 to the contents of the file msg: $ svnadmin setlog /usr/local/svn/repos/ -r 19 msg
Synopsissvnadmin verify REPOS_PATH DescriptionRun 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. ExamplesVerify a hung repository: $ svnadmin verify /usr/local/svn/repos/ * Verified revision 1729. |