svnsync

svnsync with source repository password


The source repository (UTILITIES) has anon-access = none specified requiring a password to access it. A user has been setup svnsync = sourcepass to use for syncing.

But how to I tell svnsync the username and password?

SYNCUSER=svnsync
SRCPASS=sourcepass
DESTPASS=destpass
svnsync init --non-interactive \
  --sync-username $SYNCUSER --sync-password $DESTPASS \
  --no-auth-cache \
  "file://path/to/UTILITIES" "svn://svn.company.com/UTILITIES"

If I run without --non-interactive, it will prompt me to login to the source repository.

Note: the reason for --non-interactive is because initialisation of the mirror is handled by a daemon.

See: http://svnbook.red-bean.com/en/1.7/svn.ref.svnsync.c.init.html


Solution

  • One option is to pre-cache authentication, which is what I am currently doing.

    $ svn info svn://svn.company.com/UTILITIES
    Username: svnsync
    Password: sourcepass
    Store password unencrypted (yes/no)? yes
    

    svnsync can then access the repository in --non-interactive mode.