blog-image

Sep 20, 2018

13 min read

VPS backups are simple—you’re just overthinking it

Written by

Vippy The VPS
People keep thinking that manual VPS backups are some impossible task. They demand GUIs and automated tools. They spend hours and hours trying to use obscure terminal-based backup tools. Instead, let me be the first one to say that VPS backups are actually incredibly simple. Here’s the only command you need to know:
$ rsync USER@IP_ADDRESS:/ -aAXvh \
--exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} \
/home/USER/backups/
Done. Can we stop worrying about VPS backups now? … Okay, that looks like a lot, but I promise it isn’t. We’ll come back to what that command does in a moment—first, let’s talk about why you should be backing-up your VPS in the first place. [cta_inline]

Why do VPS backups matter?

Whether you’re an owner of small business, host a simple personal website, or are working in a top-notch organization, your data is always important. But because it’s online, it always remains vulnerable to hackers, ransomware, or even accidental deletion. Having a proper backup and recovery plan is essential to protect yourself against these unexpected events. If you keep duplicate copies of your important files and store them in a separate and safe location, you can recover them if you have issues with the integrity of your data—no matter the source. Instead of just running that command without thought, you should spend a few minutes creating a proper, standardized backup policy to minimize risk and make your life easier. The frequency and time of your backup depend on how often the data changes, how much time it takes to make a backup, how much data you need to duplicate, and when visitors or user will be using your service the most. Since the backup process can use lots of system resources, you should schedule your backups for low usage times of the day. For a personal VPS, you should be doing weekly or even daily backups. Remember: Data backup and data recovery are two different things. Backups are the act of duplicating files, whereas recovery is the process of restoring data from your backup. Restoration isn’t as easy as backup, but you can’t even try restoration without a proper backup!

Let’s get into what rsync is all about

rsync stands for remote synchronization, and is a utility program to synchronize files and directories from one host to another in an efficient manner. rsync replicates an entire data set between the source and destination when it runs for the first time. After that first run, rsync only transfers data that has changed. These changes are called a delta. rsync uses compression and sends data over an encrypted SSH tunnel for robust security. The most basic use of rsync is to replicate a folder on the same host. The following example will sync all files and folders from source_folder to
Continue reading this article
by subscribing to our newsletter.
Subscribe now