Showing posts with label rsync. Show all posts
Showing posts with label rsync. Show all posts

Thursday, May 21, 2009

Continuing Broken rsync

$ ls -lah|grep nanggar
-rwxrwxrwx 1 root root 675M 2009-05-04 02:20 nanggar-alternate-i386.iso
-rwxrwxrwx 1 root root 675M 2009-05-04 03:26 nanggar-cdlive-i386.iso
-rwxrwxrwx 1 root root 334M 2009-05-20 18:22 .nanggar-cdlive-i386.iso.ThN6oe

$ dd if=nanggar-cdlive-i386.iso of=2nd-part bs=1M skip=334
$ mv nanggar-cdlive-i386.iso nanggar-cdlive-i386.iso.prev
$ mv .nanggar-cdlive-i386.iso.ThN6oe nanggar-cdlive-i386.iso
$ cat 2nd-part >> nanggar-cdlive-i386.iso
$ rsync -avP cdimage.blankonlinux.or.id::cdimage/livecd-harian/current/nanggar-cdlive-i386.iso .
Why does it matter? Because we still need old, same parts from previous iso to prevent rsync redownload them again. But how to force rsync to know that old part was already downloaded? By putting them into the same iso of course.

Old iso consists of two parts: O1 and O2. New iso consists of two parts: N1 and N2. N1 has been downloaded into dotfile, while N2 is to be checked against O2, and we only need N2 vs O2 difference. So we need to create temporary iso, which consists of N1 (=dotfile) and O2, to enable rsync delta algorithm.

I hope this idea is clear enough.

Thursday, April 23, 2009

Tips Nekat Ambil ISO Untuk Para Fakir Bandwidth (a.k.a Menyambut Rilis Ubuntu 9.04)

Ingin segera merasakan Ubuntu 9.04 tapi fakir bandwidth? Kalau anda sudah punya ISO 9.04 RC, trik ini bisa dipakai:

$ cp ubuntu-9.04-rc-desktop-i386.iso ubuntu-9.04-desktop-i386.iso
$ rsync -avP mirror.favorit.anda::ubuntu-releases/.pool/ubuntu-9.04-desktop-i386.iso .
receiving incremental file list
ubuntu-9.04-desktop-i386.iso
96623225 13% 81.49kB/s 2:10:08
Apa untungnya? Sebenarnya ISO 9.04-rc vs 9.04 hanya berbeda 'sedikit'. Dengan rsync anda hanya perlu mengambil perbedaannya, yang pasti jauh lebih kecil daripada ukuran ISO yang ~700MB. Perhatikan bahwa kecepatan unduh pernah mencapai angka yang berlipat-lipat daripada bandwidth anda. Pada saat itu, rsync mengambil potongan dari salinan lokal alih-alih dari server sumber.

Selamat menikmati Jaunty Jackalope!

ps: titik tunggal di akhir baris perintah jangan sampai tertinggal

update: pemakaian rsync dapat menghemat 584 MB
   732909568 100%  271.13kB/s    0:43:59 (xfer#1, to-check=0/1)

sent 189658 bytes received 148727157 bytes 55973.24 bytes/sec
total size is 732909568 speedup is 4.92