Skip to content
Step by Step Internet 🌐 Guides for learning to surf the Net

How to backup in Linux and backup all files and documents? Step by step guide

The backups have always been a preventive measure in emergencies to protect user information, often due to system failure. This protocol is so important that many operating systems and software do it automatically.

Computers, for the most part, do not have a native data backup function, so that the user must regularly perform manual backups, either to external storage drives or to a cloud server.

Given the Linux It is widely used for programming projects and work in general, knowing how to back up your data on this operating system becomes particularly important, and it is what we will teach you to do in the course of these paragraphs. So if you want to know about this useful process, keep reading.

What are the main reasons why you should perform backups on Linux on a regular basis?

Regardless of the type of work you do, Backing up your documents or programs is an essential step for anyone who works with computers. A security copy it becomes a guarantee that the work you have done so far will not be lost in case of an incident or attack against your computer.

Maintaining backups of your information is an essential measure of protection against attacks. If for any reason your computer or your website is the victim of a malicious attack, you will have the possibility of restoring an intact copy of your data. Besides this, backups represent a great time saver in the event that your data is compromised by malware, since you will not have to manually recreate the damaged work.

It is a legal regulation in many countries that, whoever stores their clients’ data, has the duty to protect them with maximum security.Therefore, it is not only necessary to make a backup of this information, but it is necessary to update it at least once a week. In the backups you can find useful information in case you want to find out the origin of an attack against your data, so keeping your backups as up-to-date as possible is always a good idea.

Hard Drive vs Cloud What is the best option to store my backup data in Linux?

How to save data to the cloud

In the middle of the last decade, it was common for your work to produce a large number of files weighing much more than your computer could support. In those cases, the only option was purchase an external hard drive. This process, while effective, was slow and very noisy. However, after the advent of cloud storage, Backing up information has become a much more manageable and practical process.

Of course, we cannot detract from the usefulness that hard drives represent as a backup medium, especially since we have the SSD hard drive, which can grant us a large amount of storage space. Also, there is the fact that hard drives are very versatile drives that can be portable, so you have the advantage of being able to have your information always at hand.

Too we must take into account the relevance of NAS hard drives that provide their own operating system and their own storage cloud, becoming a solid option to backup data from your home computers. Despite all this, the most effective and secure option to store your data is a cloud service. This is due to the fact that it does not require cable connections and you can access your information from any device.

Another point in favor of the cloud is the vulnerability of physical hard drives and their lifetime. Over time, their functionality is substantially reduced, in addition to being vulnerable to physical damage and shock that could endanger the stored data.

Learn step by step how to create a backup to back up important files on your Linux computer.

If you use Linux as your main operating system to work with, surely you have many projects and a lot of information that you need to protect.

Now we will show you some types of backups that can be done and how to backup your information:

Backup type

exist two types of backup that can be performed to keep your information backed up.

These are the full backup and the differential backup:

  • Full Backup: It is the simplest option and consists of making a complete backup of all the information of the operating system, its data, and files. It is, however, the least efficient option since updating this backup would take more and more time as new information is added.
  • Differential Backup: It is the most practical option, since it consists of the use of external software to only make a copy of the data that has been modified in relation to the previous backup. In order to load this copy, it is necessary to first restore a full backup, since the differential backup only covers modifications made to the information.

Choose tool

Tar GZip interface for Linux

Taking into account the two types of backups that there are, we present two tools that will allow you to perform each of them easily and quickly:

  • Tar + GZip: It is one of the simplest tool combinations, which is why it is widely used to make full backups. It consists of packing the data with Tar and compressed with GZip.
  • rsync (rsync package): This backup tool allows the user to transfer files between two remote computers. Its usefulness lies in the reduction of the volume of data that it allows, thanks to the fact that it only transfers the modifications if the receiver has a previous copy saved.

Backup

In order to make a differential backup with the Rsync tool, we must use the Linux text editor to create a small executable script that performs the backup function that we will call “rsync_backup.sh”. The first line of the script should include the command “#! / Bin / bash” which will help the file to be recognized as a script. The second line will include the dependency where the backup will take place, for example a remote hard drive “ssh”, and the folders that will not be included.

The command line will look like this:

  • rsync -azv -e ssh --exclude="Descargas" --exclude=".cache" --exclude=".thumbnails" /home/user/ [email protected]:/backups/laptop-11/

Once the script is ready, all you have to do is give it execute permissions using the Linux command “chmod”.

This command is inserted into the terminal like this:

  • chmod 755 rsync_backup.sh

When running, the script will back up all data that was not excluded to the target dependency indicated on the command line, thus allowing you to make a backup as often as you see fit.

List of the best external tools to make backup in Linux easily

Given the many operating systems have native backup tools, it is necessary to resort to external software for this purpose.

There is a great diversity of tools with many capabilities and benefits for data backup, and here are three of them:

Mondorescue.org

Download site at Mondorescue

Mondorescue is the resource to consider for safeguard and recover large amounts of dataas it is programmed to back up entire installations. Supports almost any storage medium (CD, DVD, hard disk, etc) and supports a wide variety of file systems (RAID, JFS, VFAT, etc.) and it has an active development team constantly adding new compatibility formats.

Simple Backup Solution

Simple Backup Solution Download Site

This tool is focused on desktop backups. Although it is not the best for backups of huge amounts of information, if you have a wide range of backup, as you can copy and save both files and entire directories. Access their website from your direction https://www.linuxlinks.com/simplebackupsolution/

One of its best features is the inclusion of default solutions that allow you to backup a variety of directories such as “/ var /”, “/ usr /” and “/ local /”. In addition to allowing you to schedule and customize your backups.

Bacula.org

Bacula download site

From this list, is the most comprehensive and meticulous tool for backing up, besides being completely open source and ready for business environments. However, it is also one of the most difficult to master, since has a huge number of components and utilities that make it the most powerful tool on this list, as well as the most complex.