Page 1 of 1

- Indicates where to save the result

Posted: Sat Apr 05, 2025 6:34 am
by Mitu100@
How to set up a backup in linux? How do I schedule a backup? How to restore the Linux system from the created image? The answers to all these questions can be found in this article.

The examples shown in this article are implemented on Ubuntu 20.04

Backup using console commands
The first way
It is not necessary to use third-party utilities to create a backup, just a few console commands.
An example of such commands is the following command:

tar czf /backup.tar.gz --exclude=/backup.tar.gz --exclude=/home --exclude=/media --exclude=/dev --exclude=/mnt --exclude=/proc --exclude=/sys --exclude=/tmp /

This command is executed on behalf of the Root user or a user with Sudo privileges. It takes a lot of time to create an archive because it copies absolutely the entire system. I will not paint each line, I will indicate only a few nuances

C - Creates an archive
Z - Enables compression

–exclude - Excludes certain buy bulk sms service folders and the archive itself
After the archive has been created, it is best to place it on a separate hard drive or on a USB flash drive in order to connect it in the future, if necessary, and restore the system and everything that was on it.

You can find the archive in the graphical shell and transfer it from there.

RDEBACKUP

RDEBACKUP2

To restore the system, then it will be enough to connect a USB flash drive with the archive and enter the command:

tar xf /run/media/usb-name/backup.tar.gz -C/mnt

After that, your system will be restored along with all the programs that were installed on it.