RaspberryPi cloud backup Part 1
Tags: raspberrypi, azure, aws, backup
Published: 2022-08-20 19:11:00

NAS systems are expensive. I have a bunch of hard drives lying around from broken laptops, so why not use a relatively inexpensive Raspberrypi 4 that I already own to aggregate them and share it on my network?

And that's exactly what I did. I bought a [Wavlink USB hard drive dock from Aliexpress](https://pt.aliexpress.com/item/1005002039614140.html?spm=a2g0o.ppclist.product.2.11b1f9R4f9R4XQ&pdp_npi=2%40dis%21EUR%21%E2%82%AC%2057%2C35%21%E2%82%AC%2043%2C43%21%21%21%21%21%402103222516610153382238337e3f65%2112000018512461217%21btf&_t=pvid%3A79cc763f-739b-477c-a530-aa0a83459630&afTraceInfo=1005002039614140__pc__pcBridgePPC__xxxxxx__1661015338&gatewayAdapt=glo2bra), connected 2 hard drives and downloaded and installed [openmediavault](https://www.openmediavault.org/).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzde1lhimesr6ckd0scb.png)

After combining the hard drives into one and creating a shared folder for my home network, everything worked fine.

But here's the catch. It's not the speed, because I don't need fast hard drives on my home setup. It's not the power consumption, because it consumes very low power. It's the fact that all my data is only on these hard drives. What happens if they all fail?
Sure, I can always set up a raid (on OS level since openmediavault doesn't support it). But raid isn't backup.

So I've decided that I need an inexpensive backup solution in case the hard drives stop working.
I know what you're thinking. A raspberryPi 4 with 4GB memory costs around 60€, plus the dock 40€. With all the work I have, maybe I should consider buying a NAS system. But what fun would that be, right? Right? :sweat_smile:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jacn0bt9vvjpvjsc94uk.png)
 
I want to spend as little as possible per month with this backup so let's evaluate the cheapest alternative to backup a combined number of files up to 1TB of space.

So let's see the cloud options for 1TB cloud storage:

| Cloud Provider Offer | Disk Space | Pricing per month (€) |
|----------------| -----------| ----------------------|
| Google One     | 2 TB       |     9.99              |
| Onedrive (Microsoft 365 Personal) | 1 TB | 7.00     |
| Apple iCloud | 2TB | 9.99 |
| DropBox |  2TB | 9.99 |

Well, that seems a lot of money. Let's check some cold storage then since I'm ok with having to wait some time in order to retrieve my files.

| Cloud Provider Offer | Disk Space Used | Pricing per month excluding communication (€) | Retrieval policy |
| ------| -----|------|------|
|  AWS S3 Glacier Deep Archive | 1TB | 1.8432 | For long-term data archiving that is accessed once or twice in a year and can be restored within 12 hours |
| Azure Block Blob General Purpose V2 Archive LRS | 1TB| 1.80 | The rehydration request will be processed in the order it was received and may take up to 15 hours |


Another important factor to consider is the pricing for the retrieval of the data for both [AWS](https://aws.amazon.com/s3/pricing/?nc=sn&loc=4) and [Azure](https://azure.microsoft.com/en-us/pricing/calculator/?service=storage). AWS presents the pricing using an 1000 api call and Azure presents the pricing using an 10000 api call scale.

Ok, now that we know the pricing. We just need the infrastructure (let's choose azure for this use case) and a script to backup our data periodically.

So don't miss part 2.