If you are using a rolling release distro such as Arch Linux chances are that an update down the line broke your system.
That’s why backups are so important.
There are lots of impressive backup software available for Linux. Almost all distros come with an easy to use backup tool. They back up and keep your docs, music and other important files safe.
But it’s reinstalling all the software, drivers and configuring the system if something goes horribly wrong that turns out to be a nightmare.
Timeshift does exactly that.
Easily Backup & Restore Linux Systems
A “sudo” command gone wrong, a new major Gnome release or even not updating Arch for a long time can leave your system without a graphical environment or even worse render it completely unusable.
This is where Timeshift shines.
How Timeshift Works
Timeshift doesn’t just backup your home folder and personal files. It doesn’t just backup your apps. It has the capability to capture your entire Linux system installation with all the contents in your home folder into a single snapshot. This snapshot also includes all the configurations and customizations you made to your system and all on all your installed apps.
Installing Timeshift in Linux
1. For Debian/Ubuntu based distros
Open the terminal and execute the below commands:
sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install timeshift
2. For Arch based distros
Timeshift is available in the Arch User Repository. Enable AUR and get Timeshift with the following command:
yay -S timeshift
How to use Timeshift
A. Making a backup of your Linux System
Launch Timeshift from the menu. Put in your sudo/root password when asked.
On first run Timeshift boots into a very helpful backup wizard to guide you through the necessary steps to perform your first system backup.
You can select the location to store the backup (internal or external drives or other partitions) and which files you would like to include in your backup such as hidden files, etc.
You can also enable scheduled backups to backup your system in predefined intervals.
Once your backup is finished you should view a list of available backups each time Timeshift is started.
B. Restoring your Linux system
1. Restoring from inside the OS
When you can still boot into your OS and want to go back to a previous state of your PC, just launch Timeshift and select a Restore Image and hit restore.
2. Restoring when you can’t log into your Linux system
This section is for systems which can’t log into a Graphical Environment, are completely formatted or damaged beyond repair.
You’ll need a Live USB. Almost all popular Linux distros come with a live version that boots into a fully usable Linux system prior to installation.
Boot into a live session and download and install Timeshift using the same above install instructions.
After installation, launch the application and browse to your backup location (the one defined in the backup wizard in Step A above) and select restore.
It is also recommended you let Timeshift install the bootloader again.
That’s it. You should now have a fully working system as it was the last time you created a snapshot in Timeshift.