In late February 2020, I had messed up the syntax on a rsync backup, deleting my user directory and multiple other directories in the process. As a result, the code that powered my website got lost, and I could not fully recover the site’s backend or content due to the lack of a complete backup.
Since then, I’ve begun doing proper offsite backups of content to prevent this from being an issue again.
Fortunately for me, doing regular backups paid off when the site got deleted a few days ago when I deleted the wrong directory. However, a few files were missing, which kept the site from loading as they contained the code that makes pages display article contents. Luckily, these files were in an archive, but the work taken to find them again could have easily been avoided with proper backups, which I am now doing.
A recent fire in OVH’s Strasbourg datacenter (SBG2) took around 3.6 million websites on 464 thousand individual domain names, affecting news organizations, banks, webmail services, games, online shops, and many more. While I was not affected personally by this, it shows how unexpected events can always come up. Would you want to restore your files and services on a different server or let everyone know that everything got lost from a lack of backups?
What are Backups?
A backup gets created when you take a copy of the information you wish to save, store it securely in a separate location such as the cloud, and keep it for in the event you need to recover data for any reason.
You would now be able to recover your data if something happens to it, such as data loss from a disk failing, malware, ransomware, a device or storage medium getting lost or stolen, or even human error. This way, instead of losing your work, you can rest assured that your data remains safe.
Why Are Backups Important?
According to worldbackupday.com, 30% of people have not backed up their devices. Just 30% might not seem like it would be a lot of people. However, statistics show that about 113 phones are lost or stolen every minute. The amount of data lost adds up quickly with just this statistic alone.
Simply keeping a secure backup of your data can help prevent huge problems if data loss occurs for any reason, whether from cyber threats, hardware issues, accidents, or anything else that can happen.
What Should I Back Up?
The recommended “base” I’ve found for what you should back up would be any data, files, programs, and anything else that can not get easily replaced. For individuals, this can include your documents, spreadsheets, photos, videos, music, emails, contacts, financial information, and more.
Businesses with various databases, in-house applications, custom OS images, or anything similar may take additional measures. More work and consideration may get taken to keep data safe and in the most usable forms when backed up, but this is something that your company’s IT staff should be able to manage.
How Can I Backup My Data?
No single solution is best for every device type or use case. Here are some backup methods and times where you would be able to make the most use out of them.
- Removable media: For smaller amounts of data, a USB drive, SD card, or USB hard drive may work, as long as you store the disks securely and make sure that they don’t break while in storage. Typically, storage on these devices will range between megabytes to a few terabytes. While this method may be suitable as an immediate solution, offsite backups, which are backups stored at a different physical location than the primary copy, are strongly recommended for reasons such as the OVH Strasbourg datacenter fire. Unfortunately, this method is primarily limited to desktops and some laptops.
- Cloud-based storage: For any amount of data, the cloud can provide an easy, affordable, and flexible amount of storage for your backups, with a wide range of options for how you want your data stored. Some of the most common choices include Microsoft OneDrive, Google Drive, and many other cloud file hosting providers. If you prefer to host things yourself, you may want to consider a VPS or dedicated server from a cloud hosting company such as Azure, OVH, OCI, AWS, RamNode, Hetzner, or any other provider. This method, unlike removable media, is available on virtually all devices. If fires and other issues are a concern to you, you will want to make sure to back up to multiple locations. If you do not want to manage the backups yourself, there is a wide range of professional services that can do it for you.
When Will I Need to Restore Backups?
If your computer died, got stolen, or damaged from an accident or disaster, you would want to be able to get your data back and continue from there. If your computer or phone with personal, work, school, or government files or documents got stolen or infected with ransomware, and you were not making backups, the data on that device is probably long gone now.
While our devices are functioning and datacenters are working as we expect them to, it can be easy for us to underestimate the need for backups until incidences of mass-data loss occur, such as what happened in Strasbourg. We should not be waiting for such a problem to happen to our computers or servers before deciding to make backups of our data.
As a basic solution, you can use
rsync to copy files from one device to another, as seen with the below code snippet:
rsync -avz email@example.com:/path/to/source/dir /path/to/backup/dir
These flags stand for
- -a: Archive
- -v: Increase verbosity of output
- -z: Compress
rsync utility is typically available on all UNIX-based and Linux-based operating systems, including macOS. As of Windows 10, it is now possible to use the same tools via WSL.
I cannot stress the importance of proper backups enough. Hopefully, this article helped give you an idea of various backup procedures and things you can do to prevent your data from getting lost. Here’s where many sites will have affiliate links to partnered services, but all I’m going to say here is to research different solutions and use what works best for you.
To avoid the same issues that happened to me with my website, or the customers at OVH’s Strasbourg location, make sure to do proper backups.