During implementation of DistTest I faced with necessity of building a lot of different linux kernel versions. As a first solution I chose downloading archives from kernel.org for each used version. But I soon realized that about 1000 versions of sources with size 0.5-1GB each would consume a lot of disk space. It’s also impossible to build kernel with exact commit precision using this approach.
Set of base versions with corresponding patches can save disk space, but uses a lot of random I/O during applying patches, so it’s slow on HDD and consume finite rewrite resource of SSD. Temporary nature of sources leads to conclusion “use tmpfs”. But aufs offers much less RAM consuming method – store in RAM only diffs.
Category Archives: vcs
git linuxSpace efficient source code storage
23.03.2016 – 23:28
Remote SVN backup with svnsync
07.09.2012 – 01:50
Create local svn repository with name “my_local_repo”
1 |
$ svnadmin create my_local_repo |
prepare local repo
1 2 |
$ echo "#!/bin/sh" > hooks/pre-revprop-change $ chmod 755 hooks/pre-revprop-change |
initialize local copy
1 |
$ svnsync init file:///path/to/my_local_repo http://from.server/from_repo |
first run must be interactive to input and save your login and password
1 |
svnsync sync file:///path/to/my_local_repo |
write script to run it in cron
backup_svn_script.sh:
1 2 3 |
#!/bin/bash svnsync --non-interactive sync file:///path/to/my_local_repo tar -C /path/to/ -czf /path/to/backup/$(date +"svn_%Y_%m_%d_%H_%M_%S").tar.gz my_local_repo |
it produce files like “svn_2012_09_07_01_34_01.tar.gz” in your backup directory
Now you can add task to cron. Execute:
1 |
$ crontab -e |
and add following line to run backup at 4:00 (4 a.m.) every day
1 |
0 4 * * * /path/to/backup_svn_script.sh |
This method is not disk space efficient, but very simple.
Sources:
using svnsync
installing subversion server in ubuntu