| 1 | Originally posted to: |
|---|
| 2 | <http://brad.livejournal.com/2205732.html> |
|---|
| 3 | |
|---|
| 4 | There are lots of ways to store files on the net lately: |
|---|
| 5 | |
|---|
| 6 | -- Amazon S3 is the most interesting, |
|---|
| 7 | -- Google's rumored GDrive is surely soon coming |
|---|
| 8 | -- Apple has .Mac |
|---|
| 9 | |
|---|
| 10 | I want to back up to them. And more than one. So first off, abstract |
|---|
| 11 | out net-wide storage.... my backup tool (wsbackup) isn't targetting |
|---|
| 12 | one. They're all just providers. |
|---|
| 13 | |
|---|
| 14 | Also, don't trust sending my data in cleartext, and having it stored |
|---|
| 15 | in cleartext, so public key encryption is a must. Then I can run |
|---|
| 16 | automated backups from many hosts, without much fear of keys being |
|---|
| 17 | compromised. |
|---|
| 18 | |
|---|
| 19 | Don't want people being able to do size-analysis, and huge files are a pain anyway, so big files are cut into chunks. |
|---|
| 20 | |
|---|
| 21 | Files stored on Amazon/Google are of form: |
|---|
| 22 | |
|---|
| 23 | -- meta files: backup_rootname-yyyymmddnn.meta, encrypted (YAML?) file mapping relative paths from backup directory root to the stat() information, original SHA1, and array of chunk keys (SHA1s of encrypted chunks) that comprise the file. |
|---|
| 24 | |
|---|
| 25 | -- [sha1ofencryptedchunk].chunk -- content being <= ,say, 20MB chunk of encrypted data. |
|---|
| 26 | |
|---|
| 27 | Then every night different hosts/laptops recurse directory trees, |
|---|
| 28 | consult a stat() cache (on,say, inode number, mtime, size, whatever) |
|---|
| 29 | and do SHA1 calculations on changed files, lookup rest from cache, and |
|---|
| 30 | build the metafile, upload any new chunks, encrypt the metafile, |
|---|
| 31 | upload the metafile. |
|---|
| 32 | |
|---|
| 33 | Result: |
|---|
| 34 | |
|---|
| 35 | -- I can restore any host from any point in time, with Amazon/Google |
|---|
| 36 | storing all my data, and only paying $0.15 cents/GB-month. |
|---|
| 37 | |
|---|