Site icon Information2 | Data Management & Recovery Pioneer

How to Backup and Restore Linux Server with 7 Ways

Introduction

Linux servers are the backbone of many enterprises, valued for their scalability and security. However, hardware failures, cyberattacks, or system downtime can lead to data loss, making backup and restore linux server a critical task. Below, we first explore 6 common and practical methods to achieve this, then introduce a more powerful professional solution to meet complex backup needs.

6 Common Methods for Backup and Restore Linux Server

These common methods each have their own operational logic and applicable scenarios. They can be flexibly selected based on the actual requirements of the Linux server, such as whether the backup target is a full system or specific files, whether remote transmission is needed, and the requirements for recovery efficiency.

► Method 1: Backup and Restore Linux Server Using Rsync and Cronopete

Rsync is a versatile Linux utility for file synchronization and transfer, supporting local and remote operations via shell or rsync daemon. It offers flexible parameters like verbose output (-v), backup creation (-b), file exclusion (-exclude=PATTERN), and checksum-based skipping (-c) to optimize backup processes.

Backup Steps:

sudo rsync -aAXv / –exclude={“/dev/*”,”/proc/*”,”/sys/*”,”/tmp/*”,”/run/*”,”/mnt/*”,”/media/*”,”/lost+found”} /target_folder

This backs up the entire root directory while excluding non-essential system directories.

rsync -aiz . bkhost:backup/user_name/

Recovery Steps:

Cronopete, a Linux alternative to Mac’s Time Machine, focuses on user file recovery (not full OS backup).

► Method 2: Backup and Restore Linux Server Using Bera

Bera is a streamlined backup system that simplifies backing up critical files, folders, and server configurations, supporting full backup, recovery, and server migration in just 10 minutes. It uses SSH for secure transmission and allows excluding specific domains or files.

Key Parameters:

Preparation:

Ensure the Linux server has Rsync, SSH installed, and root access to both source and target systems.

Backup Steps:

chmod +x bera-backup.sh

chmod +x bera-restore.sh

Configure the scripts using the provided examples (_bera_restore_config_example and _bera_backup_config_example).

./bera-backup.sh PATH_TO_CONFIG_FILE

Recovery Steps:

Download the backup from the server and initiate restoration with:

./bera-restore.sh PATH_TO_CONFIG_FILE

► Method 3: Backup and Restore Linux Server Using Tar

Tar (tape archive) is a classic tool for compressing and archiving files, often paired with gzip or bzip for compression. It uses simple parameters to create, extract, and list archives (known as “tarballs”).

Key Parameters:

Backup Steps:

tar -cvf backup_name.tar /home/user

tar -cvfz backup_name.tar.gz /home/user

tar –exclude file.txt –exclude file.sh -cvfz backup_name.tar.gz

sudo tar –cvpzf backup_name.tar.gz –exclude=/home/server/backup.tar.gz –one-file-system

Recovery Steps:

Extract the tar.gz archive to restore data:tar -xvpf /media/your_harddisk/backup.tar.gz

► Method 4: Backup and Restore Linux Server Using Cpio

Cpio (copy in/out) is a file archiver for creating/extracting archives or copying files between locations. It operates via standard input/output and offers features like unconditional copying and automatic directory creation.

Key Parameters:

Backup Steps:

ls file* | cpio -acvf > /root/backup.cpio

cpio -it </root/backup.cpio

cpio -it -I /root/backup.cpio

Recovery Steps:

Restore files from the archive:

cpio -icuvd </root/backup.cpio

► Method 5: Backup and Restore Linux Server Using DD Command

The DD (Disk to Disk) command is used for partition-level backups, directly copying data from one partition to another. It can create duplicate partitions without generating separate backup files.

Backup Step:

Backup a source partition to a destination partition:

dd if=source_partition of=destination_partition

Create a duplicate partition (no separate backup file):

dd if=existing_source_partition of=destination_partition

Recovery Step:

Restore the backup partition to another empty partition:

dd if=destination_partition of=another_empty_partition

► Method 6: Backup and Restore Linux Server Using SCP and Timeshift

SCP (Secure Copy) enables encrypted file transfer between Unix/Linux systems (local, remote, or between remote servers). Timeshift is a system restore tool (pre-installed on some distributions) that supports point-in-time recovery.

SCP Key Parameters:

SCP Preparation:

Backup Steps:

scp filename root@serverxxx.example.com:/root

scp root@serverxxx.example.com:/root/backup*

scp –r directory root@serverxxx.example.com:/root

scp -c blowfish filename root@serverxxx.example.com:

scp -p xxxx backup_file root@serverxxx.example.com:/tmp

Recovery Steps:

sudo add-apt-repository -y ppa:teejee2008/timeshift && sudo apt-get update && sudo apt-get install timeshift

sudo dnf install timeshift

yay -S timeshift

i2Backup: Advanced Solution for Backup and Restore Linux Server

While the above methods are effective for basic needs, they often require memorizing complex commands and lack centralized management. For enterprises or users with large-scale data protection needs, info2Soft offers a professional, user-friendly solution tailored for backup and restore Linux server.

i2Backup is a comprehensive backup and recovery software that supports multiple platforms, including a wide range of Linux distributions (SUSE Linux 11/12/15, RedHat 6/7/8, CentOS 6/7/8, Oracle Linux 6/7/8, Ubuntu 14.04-20.04, Rocky Linux, etc.). It covers backup scenarios for Linux server systems, files, databases, and virtual machines, providing one-stop data protection with flexible scheduling, secure transmission, and efficient recovery.

FREE Trial for 60-Day

We have a professional team to provide you with technical support, ensuring you won’t encounter any issues during backup and recovery process.

Conclusion

Backup and restore linux server is essential for safeguarding enterprise data, and the 6 common methods above provide practical options for different scenarios. For users seeking a more efficient, secure, and manageable solution, info2Soft i2Backup stands out with its broad compatibility, robust features, and user-friendly interface. Whether you’re handling small-scale file backups or large-scale server clusters, i2Backup simplifies linux server backup and restore processes, ensuring data integrity and business continuity. Invest in the right backup tool to avoid irreversible data loss and protect your critical assets.

Exit mobile version