Creating and Restoring Incremental backups
Incremental backup is an advanced type of backup. It only backs up what has changed since the last backup. It saves disk space and reduces the time required by the backup process. Let us take an example.
An administrator backs up a disk daily. The disk contains 60 GB of data. Only 1 GB of data changes daily. The backup utility creates 1 GB backup per minute. If the administrator takes a standard backup, he needs 375 GB of disk space and 375 minutes of working hours for a week. However, if he uses the incremental backup, he needs only 65 GB of disk space and 65 minutes of working hours for the same task.
| Day | Modified data | Data written in full backup | Time taken in full backup | Data added in incremental backup | Time taken in incremental backup |
| Monday | 0 GB | 60 GB | 60 Minutes | 60 GB | 60 Minutes |
| Tuesday | 1 GB | 61 GB | 61 Minutes | 1 GB | 1 Minute |
| Wednesday | 1 GB | 62 GB | 62 Minutes | 1 GB | 1 Minute |
| Thursday | 1 GB | 63 GB | 63 Minutes | 1 GB | 1 Minute |
| Friday | 1 GB | 64 GB | 64 Minutes | 1 GB | 1 Minute |
| Saturday | 1 GB | 65 GB | 65 Minutes | 1 GB | 1 Minute |
| Total | 375 GB | 375 Minutes | 65 GB | 65 Minutes |

The tar command
The tar is one of the most widely used backup utilities on Linux. It is part of the default installation. It allows us to create and restore backups from the CLI interface. We can use it to understand the incremental backup process.
The following tutorial explains its options and usage through examples.
Tar command Explained with Examples
Incremental backup example
Open a terminal and create a directory called practicelab. Change the current working directory to it. Create two directories: backup and restore. Enter the backup directory and create some large-sized text files. You can redirect manual pages to text files. We will use this directory as the source directory for backup and another directory (restore) as the destination.

Creating full backups
An incremental backup always starts with a full backup. It uses this backup to compare and detect the changes. The tar command creates a snapshot file while creating the full backup. It contains a list of all files and directories added to the backup with their last modification dates. Next time, it checks this file to find out what files and directories have changed since the previous backup and writes only those changed files and directories.
The following command creates a full backup.
#tar -czvg snapshot-file -f backup.tar.gz backup
Following is the explanation of the above options and arguments.
tar
This is the primary command.
-czvg
These are the options. These options create a backup, compress the backup with the gzip utility, display the progress of the backup process, and update the snapshot file to identify the modified files.
snapshot-file
This is the file that stores a list of files and directories this command adds to the archive. You can use any descriptive name for this file. By default, the command creates this file in the current directory. To save it in another directory, specify its complete path. For example, the /root/backup-list as an argument creates a snapshot file named backup-list in the /root/ directory.
-f
It specifies the name and location of the backup file. A backup file is also known as an archive or tarball. An archive or a tarball is the collection of multiple files and directories grouped as a single file in the backup process.
backup.tar.gz
This is the name of the archive or tarball file. Like the snapshot file, you can use any name or location to store this file.
backup
This is the name of the directory which files and directories we want to add to the archive. You can specify a single file, multiple files, a single directory, or multiple directories. If a directory contains sub-directories, it also adds them to the archive.
After creating the full backup, you can use the following command to verify it.
#tar -tvf backup.tar.gz
This command lists the files and directories stored in the archive file backup.tar.gz.

Creating an incremental backup
The same command and options create an incremental backup. It uses the snapshot file to determine whether it is a full or incremental backup. If the snapshot file exists, it’s an incremental backup. If not, it is a full backup.
While creating incremental backups, you must use the same snapshot file and a different backup file every time. Since it uses the snapshot file to identify the changes, using a new snapshot file forces the command to create the full backup. It adds modified and new files to the specified backup. If you use the same backup file again, it will overwrite the existing files.
Let us take an example. Create a new file in the backup directory and run the following command.
#tar -czvg snapshot-file -f 1-backup.tar.gz backup
The above command reads the snapshot-file file to figure out the newly created and modified files since the last backup. If it detects a change, it adds the changed or newly created files to the backup file (backup.tar.gz).
Now, modify an existing file and repeat the above command.
#tar -czvg snapshot-file -f 2-backup.tar.gz backup
It detects the modified file and adds it to the backup file 2-backup.tar.gz. You can use the following command to verify the updated backups.
#tar -tvf 1-backup.tar.gz #tar -tvf 2-backup.tar.gz

Restoring incremental backups
You are required to restore incremental backups in the order you created them. First, restore the full backup. Then, restore all sequential files up to the last backup file. The options -xvf restore files. For example, the following commands restore backup files created in the preceding example.
#tar -xvf /root/practicelab/backup.tar.gz #tar -xvf /root/practicelab/1-backup.tar.gz #tar -xvf /root/practicelab/2-backup.tar.gz
By default, the tar command restores backup files in the current directory. For example, running this command from the /home/test directory restores backup files in the /home/test/ directory. If we execute it from the /root/practicelab/restore directory, it restores them in the /root/practicelab/restore directory.
To restore the backup in a particular directory, change the current working directory to that directory. For example, if you want to restore the backup in the /var directory, switch to the /var directory before executing the tar command.
Instead of switching to the target directory, you can use the option -C. It allows you to restore the backup in any directory from the current directory. For example, the following commands restore backups in the /root/practicelab/restore directory.
#tar -xvf /root/practicelab/backup.tar.gz -C /root/practicelab/restore #tar -xvf /root/practicelab/1-backup.tar.gz -C /root/practicelab/restore #tar -xvf /root/practicelab/2-backup.tar.gz -C /root/practicelab/restore
The above commands use the absolute paths of the source and destination. It allows you to create and restore the backup from any directory.

Conclusion
Creating and restoring backups are essential system administration tasks. In this tutorial, I explained how to create and restore incremental backups.
Author Laxmi Goswami Updated on 2026-05-22