Skip to content Customize
Backup and Continuity

The 3-2-1 backup rule: three copies, two media, one off-site

2 September 2026 9 min read
Share this post

The server of a shop that takes 300 orders a day is hit by ransomware one night. There is a backup, but it sits in a folder on the same server and it has been encrypted too. The 3-2-1 backup rule exists for exactly this scenario: three copies of the data, on two different media, at least one of them somewhere else. Below we cover today's reading of the rule, RPO and RTO, an example you can build with restic on S3, and restore drills.

The 3-2-1 backup rule: three copies, two media, one off-site

What does the 3-2-1 backup rule say?

The rule is made of three numbers. Three copies: the live data and two backups. Two media: the copies should not sit in two places of the same kind that the same fault can hit; for example the server's NVMe disk and an object storage. One off-site: at least one copy should be in another building, at another provider or in another city.

It looks simple on paper and often breaks in practice. If the third copy is in the same cabinet as the live server, on the same power feed or under the same admin account, you count three copies, but one fire, one wrong command or one stolen password takes two of them at once. RAID does not count either. RAID keeps the system running when a disk fails; a file that is deleted or encrypted is deleted or encrypted on all disks at the same time.

3-2-1 diagram: live server disk, backup in S3 object storage and an offline copy at another location

3-2-1-1-0: the rule today

Once ransomware started going after backups too, two digits were added to the rule. The first extra “1”: one of the copies should be offline or immutable. An offline copy is one the attacker cannot reach over the network, such as a disk or tape disconnected from the network. An immutable copy cannot be deleted or overwritten for a set period; in object storage this is usually done with object lock.

The second extra “0”: zero errors in restore tests. A backup job finishing “successfully” does not mean the system will boot from that backup. A copy you do not regularly restore and read is a copy you do not really know exists.

RPO and RTO: write down the target first

Answer two questions before choosing a product or tool. RPO (Recovery Point Objective) is the maximum data loss you can accept, measured in time. RTO (Recovery Time Objective) is the longest time you accept for the service to come back after a failure.

For the shop with 300 orders a day, losing a day of orders is not acceptable; if the RPO is one hour, you must back up the database every hour. If the RTO is four hours, you need to measure that pulling 200 GB back from the backup target and rebuilding the system takes less than four hours. For an accounting office a nightly backup, that is a 24-hour RPO, may be enough. If these two numbers are not written down, the backup plan is guesswork.

A snapshot is not a backup

A virtual server snapshot keeps the state of the disk at a given moment on the same storage. It is very useful as a quick rollback point before an update. But because the snapshot sits on the same storage as its source, if that storage goes, the snapshot goes too. As the snapshot chain grows, disk performance also drops.

There is also a consistency problem. A snapshot of a running MySQL server may be taken in the middle of a write. That is why it is safer to back up databases separately with the database's own tool (e.g. mysqldump --single-transaction). Do not count a snapshot in the 3-2-1 tally; treat it as a convenience.

Against ransomware: separate identity, separate permissions

When an attacker takes over the live server, backups are one of the first places they look. If the backup server uses the same admin account, the same directory service or the same storage key as the live system, the attacker can delete the backups too. The rule is simple: the identity and permissions of the backup must be separate from the live system.

In practice this means the following. The write key for the backup target should exist only where the backup job runs and should not be used for anything else. Backup consoles should be accessed with two-factor authentication. The live server should not push the second copy; the system at the second location should pull it on its own schedule. That way someone who breaks into the live server does not find the path to the second copy there. Tools like restic encrypt the repository with a password; keep that password in a password vault separate from the server, because if the password is lost, the backup cannot be opened.

Example setup: VDS, restic, S3 and a second location

If you have a web hosting package, you can take the first copy with cPanel's backup tool and download it. On a VDS with root access, restic is a good start: an open-source backup tool that encrypts, stores repeated data only once and writes directly to S3-compatible targets. The example below is for Ubuntu 24.04. Your bucket name is your service number starting with “to” in the panel; to12345 is only an example.

sudo apt install restic

# Take these from the "Object storage" section in the panel
export AWS_ACCESS_KEY_ID="write-access-key"
export AWS_SECRET_ACCESS_KEY="write-secret-key"
export AWS_DEFAULT_REGION="region-value-from-panel"
export RESTIC_REPOSITORY="s3:https://s3.trecloud.com.tr/to12345"
export RESTIC_PASSWORD_FILE="/root/.restic-parola"

# Repository password: create once, keep a copy outside the server
openssl rand -base64 32 > /root/.restic-parola
chmod 600 /root/.restic-parola

restic init

Once the repository is ready, the daily job consists of four commands: back up files, back up the database with a consistent dump, clean old backups according to the retention rule, and check the repository. Put these commands in a script and run it at night with cron or a systemd timer.

restic backup /var/www /etc
mysqldump --single-transaction --all-databases | restic backup --stdin --stdin-filename tum-veritabanlari.sql
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
restic check

In this setup the live disk is the first copy and the S3 bucket is the second copy on a second medium. For the third copy, pull the bucket to another location: a NAS in the office, a server on your premises or storage at another provider. Let the system at the second location do this with the read key; for the steps, see the article S3 backup with rclone. If you copy this to an external disk once a week and disconnect the disk from the network, you also get the offline copy of 3-2-1-1-0.

Restore drills

You only see that a backup works by restoring it. Do the drill not on the live server but on a separate test machine or in a separate folder, and measure the time. If the time you measure is longer than your RTO, the plan has to change, not the tool.

restic snapshots
restic restore latest --target /root/geri-yukleme-testi
restic check --read-data-subset=5%

The first command lists the backups taken, the second restores the latest backup into a test folder, and the third checks the repository by actually reading part of the data. Then load the database dump into an empty test database and see the site open. A drill routine can look like this:

  1. Every month: restore one file and one database table and check their content.
  2. Every three months: do a full restore and compare the time with your RTO.
  3. At every drill: write the date, duration, problem and fix in a short record.

We explain in detail why drills get postponed and what happens then in our article on restore drills.

Which piece sits where at TreCloud?

TreCloud's S3 object storage packages are the backup target in this setup; they are not a backup service in themselves. You take the backup with a tool such as restic, rclone or Veeam. The packages offer an Amazon S3-compatible API, data is stored in Türkiye, access is over HTTPS, and egress traffic is free, so a large restore does not create a separate traffic charge. The quota is hard: an e-mail arrives when usage reaches 80%, and when the ceiling is reached writes stop while reads continue. So if the quota fills up, your backup job stops; do not ignore the warning e-mail. If the concepts are new to you, the article What is S3 object storage is a good introduction.

To be honest: versioning and object lock are not on the product card. Someone with the write key can delete the backups in the bucket. Meet the immutable-copy requirement with another layer instead: an offline disk at the second location or a separate target that offers this feature. If you need it, you can ask through a support ticket. One more note: if your VDS is also at TreCloud, the S3 copy is a different medium but in the same facility; for the off-site requirement, pull the third copy somewhere else.

The Add-ons tab of the VDS customer panel lists “Automatic backup” and “Backup space” add-ons; clarify their scope before ordering. If you want the backup to be managed, see the backup service (BaaS), Veeam cloud backup, Acronis Cyber Protect and disaster recovery service (DRaaS) pages; the scope is set in the quote according to your workload.

Frequently asked questions

Does RAID replace a backup?

No. RAID keeps running when a disk fails; a deleted or encrypted file is deleted or encrypted on all disks at the same time.

Is TreCloud S3 a backup service?

No, it is a backup target. You take the backup with a tool such as restic, rclone or Veeam; versioning and object lock are not on the product card.

How often should I test restores?

A small restore every month and a full restore every three months is a good start. Compare the full restore time with your RTO target.

What happens if I lose the restic password?

Because the repository is encrypted, you cannot open the backup. Keep the password in a password vault separate from the server.

Related pages

Comments0

No Comments Yet

Be the first to share your thoughts.

Join the Discussion

Please sign in or sign up to leave a comment.

Never Miss a Post

Get our latest tutorials, guides and product news in your inbox.

You're subscribed to our newsletter.