Sometimes you need to backup some files on your operating system. Windows has a tool called System Restore with which you can restore your Windows to its previous state. But Linux distributions usually do not have a default application for this purpose. In this tutorial we are going to teach you about How to Backup on with Timeshift on Ubuntu 22.04. We suggest that you visit the packages offered on the Eldernode website if you would like to purchase an Ubuntu VPS server.
Table of Contents
Tutorial Backup on with Timeshift on Ubuntu 22.04
What is Timeshift?
Timeshift is a software that provides a function similar to System Restore on Windows or Time machine on Mac. Timeshift protects your system at regular intervals by taking snapshots. These snapshots can be restored and restore the system to the exact moment it was recorded.
This software is similar to rsnapshot, Backln Time and Timevault in some ways, but with a different approach. This program is only designed to protect system files and system settings and excludes user files such as documents, photos and music.
Timeshift creates snapshots of the file system using two modes:
1) BTRFS: In this mode, snapshots are taken using the BTRFS file system.
2) RSync: In this mode, snapshots are taken using Rsync and hard links and common files are shared between snapshots to save disk space. Also Rsync can store data anywhere.
Follow us in this article to teach you step by step how to install Timeshift on Ubuntu 22.04.
How to Install Timeshift on Ubuntu 22.04
First update your system using the following terminal command:
sudo apt update
sudo apt upgrade -y
You do not need to add an additional repository to install Timeshift, as its packages already exist in Ubuntu’s default system repository. Therefore, start the installation using the following command:
sudo apt install timeshift
To have the latest stable version, there in another option to install Timeshift, which is the use of LaunchPAD PPA. To do this, first enter the PPA using following command:
sudo add-apt-repository ppa:teejee2008/timeshift -y
Then do the following update to reflect the newly added PPA:
sudo apt-get update
Now run the following command to install the latest version of Timeshift:
sudo apt install timeshift
This completes the Timeshift installation. You can find the software in the following path:
Activities > Show Applications > Timeshift
How to Create Backup Using Timeshift
You can use the following two methods to make a backup of Ubuntu 22.04 system:
–> Timeshift Graphical User Interface (GUI)
–> Timeshift’s command line
Using Timeshift GUI to Create Backups
After setting up Timeshift, you have two options:
–> Use the Rsync protocol as the primary backup tool.
–> Use the BRTFS internal file system features.
In this tutorial, we will examine how to backup with Rsync. To do this, just follow the steps below. The first step is to run Timeshift.
Then, select RSYNC and click Next:
Timeshift after checking the file system partitions, offers the appropriate option for the location of the backup file. After selecting click Next:
Now select how often you want to backup your system, this will automatically create snapshots according to the selected snapshot levels, then select Next:
As shown in the image below, the main directories have been removed by default. Select whether you want to backup home directories and click Next:
Your initial setup is complete now. Click Finish:
Click the Create button to have Timeshift start creating backup snapshots:
You should now see your first backup snapshot in the list. Select the backup snapshot you want to recover and click the Restore button:
Timeshift gives you an option on how to recover from backup. Click Next to go to default:
Timeshift provides a list of changes needed to recover from backup to ensure that no data is lost in the process. After selecting the Next button, the system will be restored:
Using Timeshift’s Command-Line to Create Backups
You can easily create a backup using the following command:
sudo timeshift --create
The output will be as follows:
First run mode (config file not found) Selected default snapshot type: RSYNC Mounted /dev/sda2 at /media/root/359151f5-efb9-483d-a738-894d57e2d8c8. Selected default snapshot device: /dev/sda2 ------------------------------------------------------------------------------ Estimating system size... Creating new snapshot...(RSYNC) Saving to device: /dev/sda2, mounted at path: /media/root/359151f5-efb9-483d-a738-894d57e2d8c8 Synching files with rsync... Created control file: /media/root/359151f5-efb9-483d-a738-894d57e2d8c8/timeshift/snapshots/2020-02-19_18-32-36/info.json RSYNC Snapshot saved successfully (39s) Tagged snapshot '2022-02-23_18-32-36': ondemand
List the system backup screenshots with the following command:
sudo timeshift --list
The output will be like this:
Device : /dev/sda2 UUID : 359151f5-efb9-483d-a738-894d57e2d8c8 Path : /media/root/359151f5-efb9-483d-a738-894d57e2d8c8 Mode : RSYNC Device is OK 1 snapshots, 197.7 GB free
Num Name Tags Description ------------------------------------------------------------------------------ 0 > 2022-02-23_18-32-36 O
You can restore the backup snapshot with the following command:
sudo timeshift --restore --snapshot "2022-02-23_18-32-36"
You can delete the selected backup snapshot with the following command:
sudo timeshift --delete --snapshot '2022-02-23_18-32-36'
In this article, you learned about Timeshift, which is one of the best tools for backing up files in Ubuntu 22.04. We also looked at how to connect Timeshift on Ubuntu 22.04 and backup files using beneficial methods. If you have any questions about this post, please post them in the comments section.