23.05.2025

How to backup data in Linux?

Backup (or backup) is an important procedure for ensuring the safety of data. In Linux, there are many tools that allow you to set up automatic or manual creation of copies of files, directories, or the entire system. In this article, we will tell you what backup is, why it is needed, and how to implement it in practice.

In Linux, you can create backups manually or using special programs and scripts. Depending on the tasks, backups can be:

The choice of method depends on the amount of data, copying speed, and storage strategy. Popular backup utilities.

Rsync

Rsync is one of the most popular and flexible utilities. It allows you to synchronize data between local and remote machines.

Example command for backup:

apt update && apt install  rsync && rsync -av --delete /home/user/ /mnt/backup/user/

Screenshot № 1 — Rsync

Flags:

Tar

Tar is a standard utility for creating archives.

Creating an archive:

tar -czvf backup.tar.gz /home/user/

Screenshot № 2 — TAR

Key decryption:

Timeshift

Timeshift — A graphical utility suitable for creating system snapshots (especially on desktop distributions).

sudo apt install timeshift

The utility allows you to configure a backup schedule and use rsync or Btrfs file systems.

BorgBackup

BorgBackup — A modern CLI solution with encryption and deduplication support.

Installation:

sudo apt install borgbackup

Example of creating an archive:

borg init --encryption=repokey ./
borg create ./::my-backup-2025-05-23 /root

Screenshot № 3 — Borg

You can use the cron task scheduler for automatic backups. Example of a daily backup task at 2:00 AM:

0 2 * * * rsync -a /home/user/ /mnt/backup/user/

Recommendations:

Backup in Linux is a simple, but extremely important process. Using available tools, you can set up reliable protection for your data, minimize the risk of loss and ensure stable operation of the system.