Skip to content

Instantly share code, notes, and snippets.

@131
Last active February 7, 2022 08:49
Show Gist options
  • Save 131/8f41492220a5fc4dc444680951b7380a to your computer and use it in GitHub Desktop.
Save 131/8f41492220a5fc4dc444680951b7380a to your computer and use it in GitHub Desktop.
Save huge directories using svn

Saving big (100GB+) directories with lots of files under subversion will most probably fail (due to timeout/exeeded RAM consumption & co). Instead of One Big Failing Transaction, commit your data in chunks.

#!/bin/bash
# First, commit directory structure
# find -type d |  xargs  -d '\n' svn add --depth=empty


# Then, commit all files in chunks

for i in {1..200}
do

   echo "Welcome $i times"

   svn status | grep "^\?" | awk '{print $2}' | head -n 1000 | xargs  -d '\n' svn add
   svn commit  -m "With chunk  $i/200" 

done



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment