svn-backup-dumps(1)

πŸ’Ύ svn-backup-dumps β€” bestie edition πŸ’Ύ

okay so you know the svn-backup-dumps(1) page from the General Commands Manual? yeah. we're doing it. it's a whole vibe and honestly it's SO useful, let me put you on 🫢


✨ NAME ✨

svn-backup-dumps β€” create dumpfiles to backup a subversion repository.

like. that's the whole thing. it makes dumpfiles. it backs up your subversion repo. iconic behavior honestly πŸ‘‘


✨ SYNOPSIS ✨

svn-backup-dumps <repos> <dumpdir>

two args, no notes. repos and dumpdir. that's it, that's the whole invitation πŸ’…


✨ DESCRIPTION ✨

so svn-backup-dumps creates dumpfiles from a subversion repository. it's literally designed to live inside cron jobs and post-commit hooks β€” like it was born for that. it's giving "reliable little background gremlin that never misses" 🧚

the basic modes of operation are, and I'm obsessed with how clean this is:

  • create a full dump (revisions 0 to HEAD)
  • create an incremental dump containing at most N revisions
  • create incremental single-revision dumps (for use in post-commit)

now the naming, and pay attention because this is the part everyone gets confused about:

dumpfiles are named in the format basename.rev.svndmp or basename.rev.rev.svndmp, where basename is the repository directory name, and the rev arguments are the first and last revision numbers represented in the dumpfile, zero-padded to 6 digits. six digits. not five, not seven. six. periodt πŸ’€

optionally, svn-backup-dumps can compress dumpfiles with gzip or bzip2, and it can transfer them to another host using FTP or SMB (using smbclient). so it's not just a backup tool, it's a backup tool that also moves your stuff across the network 🌈


✨ OPTIONS ✨

okay here's the menu, bestie, read it all, I'm not letting you skip:

  • --version β€” show program's version number and exit. cute, quick, done.
  • -h, --help β€” show this help message and exit. the classic "wait what does this do again" button πŸŽ€
  • -b β€” compress the dump using bzip2.
  • --deltas β€” this is passed through to svnadmin dump. it's not doing anything spicy itself, it's just the messenger πŸ¦‹
  • -c count β€” maximum number of revisions per dumpfile. count, okay? you're capping it.
  • -o β€” overwrite files.
  • -O β€” overwrite all files. yes, uppercase. yes, it's different from -o. yes, they WILL judge you if you mix them up.
  • -q β€” quiet. shhh. no yapping 🀫
  • -r rev β€” specify a single-revision dumpfile.
  • -t ftp:host:user:password:path, -t smb:share:user:password:path β€” transfer dumps to another machine using the FTP or SMB protocols. path is where to store the dumpfiles on the remote server; any occurrence of %r in the path is replaced by the repository name. support for "smb:" requires the smbclient program.
  • -z β€” compress the dump using gzip.
ngl the -t one is doing a LOT of heavy lifting in a single flag. look at it. five colon-separated fields. it's giving main character energy and honestly? respect πŸ’œ

✨ EXAMPLES ✨

this is the part where it all clicks, I promise πŸ“

🌸 full dump of everything

to create a full dump of all revisions of a repository /srv/svn/foo in the directory /var/backup/svn:

svn-backup-dumps /srv/svn/foo /var/backup/svn

the dumpfile will be named src.000000-NNNNNN.svndmp.gz where NNNNNN is the head revision number.

(yes it says src. yes you read that right. no, don't ask me why, I just work here πŸ’€)

🌸 incremental dumps, max 1000 revisions each

to create incremental dumps containing at most 1000 revisions:

svn-backup-dumps --deltas -z -c 1000 /srv/svn/foo /var/backup/svn

if the youngest revision is 2923, it creates the following files:

foo.000000-000999.svndmp.gz
foo.001000-001999.svndmp.gz
foo.002000-002923.svndmp.gz

if run again, later, when the youngest revision is 3045, it creates these two files:

foo.002000-002999.svndmp.gz
foo.003000-003045.svndmp.gz
note that it does not remove the redundant file foo.002000-002923.svndmp.gz. it just leaves it there. chilling. existing. living its best life. you have to deal with that one, bestie, the tool is not gonna do it for you 😭

🌸 single-revision dumps from a post-commit hook

to create incremental single-revision dumps from a post-commit hook:

svn-backup-dumps -r $rev $repos /var/backups/svn

where $rev and $repos are variables previously set in the post-commit script from its command line. the dumpfile name will be in the form foo.000352.svndmp.

🌸 sending it over SMB

to send the dumpfiles to the SMB share \\ERNEST\BACKUPS in a directory \svn\foo with user svnuser and password w0rth1ng:

svn-backup-dumps -t "smb://ERNEST/BACKUPS:svnuser:w0rth1ng:svn/%r
/srv/svn/foo /tmp/tmpbackup

note that the %r in the path is replaced by the repository name foo.

note also that a local backup directory is required, at present, even when using the -t option. so don't think you can skip the second argument. you can't. put the temp dir in there. I'm serious πŸ™ˆ

✨ AUTHOR ✨

voluntary contributions made by many individuals. Copyright Β© 2006 CollabNet.


okay that's the whole page bestie, you're now certified in svn-backup-dumps πŸŽ“βœ¨ go forth and back up your repos responsibly. this one was dated 2006-11-09 and it's the svn-backup-dumps(1) page from the General Commands Manual β€” a genuine vintage icon, lowkey a legend, we love her πŸ’–πŸ‘‘πŸ¦‹