Ubuntu is a relatively secure Linux distribution, but you can’t protect against data loss. There is always a possibility that you might make a mistake or have a hardware problem and lose your valuable data. That’s why it’s important to back up regularly. This article will teach you How to Create a Backup and Restore on Ubuntu 20.04. Eldernode offers an economically Ubuntu VPS Server, which you can check out the offered package to purchase it.
Table of Contents
How to Create Backup and Restore on Ubuntu
There’s always the possibility to lose valuable data and creating a backup copy of important files is always a good idea, as it can help you recover your data in the event of a system crash or accidental deletion. Backing up in Ubuntu is quick and easy. Follow the steps below to create a backup and restore it in Ubuntu 20.04.
Creating Backup on Ubuntu 20.04
In this step, you will learn how to create a backup and restore on Ubuntu 20.04 using the Timeshift command line.
Firstly, you can create a first backup simply with the following command:
sudo timeshift --create
This will create a new configuration file at /etc/timeshift.json location.
The output should 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 '2023-05-04_15-30-37': ondemand
To list all your currently created system backup screenshots, run the command below:
sudo timeshift --list
The output should look something 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 > 2023-05-04_15-30-37 O
Restoring on Ubuntu 20.04
You can restore from the backup snapshot using the following command:
sudo timeshift --restore --snapshot "2023-05-04_15-30-37"
If you want to delete the selected backup snapshot, run the command below:
sudo timeshift --delete --snapshot '2023-05-04_15-30-37'
That’s it!
Conclusion
If you want to protect against data loss, you should create a backup copy of important files. I hope you found this tutorial useful and that it helps you create a backup and restore your Ubuntu VPS server. You can contact us in the Comments section if you have any questions or problems during the process.