在向SVN的库中提交文件的过程中,遇到有大文件的情况,本例中差不多是200M多一点儿的样子,这样commit的过程非常漫长,中间看不到任务进度条等动态提示的信息。
一开始,想利用一个晚上的时间总可以把文件上传上去了,但是,第二天到单位一看,竟然是提示commit failed。原因是timeout。
所以,考虑将打文件分割成多个小文件上传,使用的时候,下载后再恢复到源文件的形式;
dingq@dingq-DUT:~/startech_pdu/fw/dir-struct/tools$ lltotal 206084
-rw-r--r-- 1 dingq dingq 211025920 2012-04-24 09:36 arm-2007-01-21.iso
使用命令split将文件分割:
dingq@dingq-DUT:~/startech_pdu/fw/dir-struct/tools$ split -b 5m arm-2007-01-21.iso arm-2007-part-
dingq@dingq-DUT:~/startech_pdu/fw/dir-struct/tools$ ls
arm-2007-01-21.iso arm-2007-part-ag arm-2007-part-an arm-2007-part-au arm-2007-part-bb arm-2007-part-bi README
arm-2007-part-aa arm-2007-part-ah arm-2007-part-ao arm-2007-part-av arm-2007-part-bc arm-2007-part-bj
arm-2007-part-ab arm-2007-part-ai arm-2007-part-ap arm-2007-part-aw arm-2007-part-bd arm-2007-part-bk
arm-2007-part-ac arm-2007-part-aj arm-2007-part-aq arm-2007-part-ax arm-2007-part-be arm-2007-part-bl
arm-2007-part-ad arm-2007-part-ak arm-2007-part-ar arm-2007-part-ay arm-2007-part-bf arm-2007-part-bm
arm-2007-part-ae arm-2007-part-al arm-2007-part-as arm-2007-part-az arm-2007-part-bg arm-2007-part-bn
arm-2007-part-af arm-2007-part-am arm-2007-part-at arm-2007-part-ba arm-2007-part-bh arm-2007-part-bo
其中,README中放了恢复源文件的方法:
dingq@dingq-DUT:~/startech_pdu/fw/dir-struct/tools$ cat README
Use the following command to restore the original file:
cat arm-2007-part-* > arm-2007-01-21.iso
rm -f arm-2007-part-*
分割以后使用Rabbit SVN再提交,可以看到大约每2分钟左右上传一个5M的文件,
先是add所有需要添加的文件,之后,每隔2分钟左右看到一个文件changed,这样,过差不多1个小时多一些,全部文件上传完毕。