Kategorie
Home DIY NAS on Raspberry Pi - backup, backup, backup
Home DIY NAS on Raspberry Pi - backup, backup, backup
RAID vs RSync
One of the main reasons for NAS is - in addition to the convenience of having everything together - a backup of data. In NAS users typically used RAID. Depending on the number of disks, you can choose the RAID type according to the desired features/advantages. But beware! RAID is not a full backup. Typically, using RAID 1 in the case of two spinning disks increases the robustness of the solution, i.e. if one spinning disc is damaged, you have the same data on the second disc. But what if you damage/delete data on first disc? This action will also be performed on your mirrored disk. What happens in the case of cryptovirus? Encrypts data on both drives.
In a home environment, we recommend automatically copying the data to a second disk. For these purposes, there is an RSync tool in Linux world. You can set an automatic backup of the entire content or specific folders for each night or as needed. It can even keep the same content as the primary disc and keep files that have already been deleted on the primary disc. If you make a mistake, your data will be available on a second disc for some time. Only the special user has access to the second disc, so the cryptovirus can't get in. At least not for old content.
Rsync settings
Firstly, you must have Shared Folders on primary and secondary disc. To distinguish them easily, the main folder on drive A is called Photo and the folder where the backup on drive B will be made is named PhotoBackup in example.
Under Rsync tab, turn on the server service. Then switch to Jobs and add a job that runs a backup at a given time of the week. On the screenshot below is a Photo backup setting from A to PhotoBackup folder on B, each day at 3:00 a.m. There is no deletion of photos that no longer exist on drive A. Of course, this can be changed in the Delete box settings.
What else?
But even this solution is not a full-fledged backup. In any case, you must have an old USB drive or network location, where you copy the NAS contents once every 6 months and place the disk preferably in a safe or somewhere safe outside your house. This will protect your photos and data from fire and other catastrophic scenario. Do not forget for this kind of offline copy!
Add comment