Get files from SVN via wget
July 11, 2011 4 Comments
If one has to manually download all the stuff from a given SVN-branch, this could be a very tedious task right-clicking every thing and saving it to local disk. Luckily this could be automated via wget, which comes with most Linux distributions (there are Windows-ports out there too).
If for example I want to download all the stuff from http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticForms/ I “wget” it this way:
wget -e robots=off --wait 1 -r -I /svnroot/mediawiki/trunk/extensions/SemanticForms/ http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticForms/
“-e robots=off” ignores the robots.txt
“–wait 1″ waits 1 second between the downloads
“-r” scans the server recursively
“-I /svnroot/mediawiki/trunk/extensions/SemanticForms/” includes the given path and below (excluding all the rest)
The latter one (“-I …”) is important! If omitted, wget would scan the whole server up and down – not limited to the “SemanticForms”-subdir.
There is an easier way of limiting the wget-operation to the given branch: the “-np” option. This switch keeps wget from ascending to the parent directory. So you could omit the -I mentioned above and use -np instead to get the same result with less typing. (Thank you Joe for the advice!)