There are multitude of applications available to backup data in Linux and Unix operating systems. In this guide, we will see how to backup and restore files using Deja Dup in Linux.
Computer data has become one of the most valuable assets that individuals, organizations and enterprises own today. Losing your important data would be a disaster. So backups are vital!
If you are a new user who is switching to Linux from another OS, then the first thing you should consider is what backup solutions you are going to use.
There are many open-source tools available for backups. One among such tools is Deja dup, a simple backup application for GNOME systems.
What is Deja Dup?
Déjà Dup is an easy-to-use, personal backup tool for your Linux desktop systems. It is actually a backup wrapper utility that uses duplicity under the hood.
Heads Up: For those who don't know, duplicity is a command line backup tool that uses
rsync to generate incremental, encrypted backup volumes.
Using Deja Dup, you can easily backup and restore data via a simple graphical interface. It integrates well into your GNOME desktop, so you can use it on any Linux distribution that has GNOME DE installed.
You are allowed to set which folders to backup and which folders to ignore from backup.
The backup location can be a local or a remote directory or Google drive. As of writing this, Deja dup allows us to store backup in a remote share via SSH, Samba, WebDAV, FTP, NFS and afp (AppleTalk) protocols.
Deja Dup supports automatic, scheduled backups, so you can create daily and weekly backups. It uses a built-in program named
deja-dup-monitor to perform scheduled backups.
Heads Up: Please note that the backup will not start when a user is not logged in. It is one big disadvantage of Deja Dup.
By default, Déjà Dup will make a new full backup every three months. You don't need to worry about low disk space. Deja Dup lets you to delete old backups after a particular period of time.
You can set backup retention period for at least three months, six months, or a year. By default, it keeps the backups forever.
Note: The oldest backups will still be deleted earlier if the backup location is running out of space, or kept to three months longer to avoid deleting related backups.
Since Deja Dup uses duplicity as the backend, you can compress and encrypt the backup data using a password. Whenever you want to restore the data, simply provide the correct password. For those wondering, duplicity uses gpg with symmetric cipher for encryption.
Please be mindful that Deja Dup is not suitable for backing up your entire Linux system. It is a viable solution to backup a specific file or directory.
Hope you got the basic idea about Deja Dup. In the subsequent steps, we will see how to install Deja Dup and how to use Deja Dup to backup and restore files in Linux.
Install Deja Dup in Linux
Deja dup is available in the official repositories of most Linux distributions. The version may differ between different distributions. You can look at the official release page to know about the latest version.
To install Deja Dup on Alpine Linux, run:
$ sudo apk add deja-dup
On Arch Linux and its variants like EndeavourOS and Manjaro Linux, run:
$ sudo pacman -S deja-dup
On Debian, Ubuntu, Linux Mint, Pop OS:
$ sudo apt install deja-dup
On Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux:
$ sudo dnf install deja-dup
$ sudo zypper install deja-dup
Like I already mentioned, the version of Deja Dup in the default might be bit old. Deja Dup latest version can be installed either from snap store or flathub.
If you prefer to use Snap version, run:
$ sudo snap install deja-dup --classic
If you do not prefer snap, you can install Deja Dup from flathub using flatpak command:
$ flatpak install flathub org.gnome.DejaDup
$ flatpak run org.gnome.DejaDup
Backup and Restore Files using Deja Dup in Linux
Deja Dup usage is fairly simple and straight-forward. It greatly reduces the complexity of backing up files for newbies.
First, we will see how to backup files using Deja Dup.
Backup Files with Deja Dup
Launch Deja Dup from Dash or Application Menu. It may show up as simply "Backups" in menus, app launchers, and some in-app text.
The default interface of Deja Dup should look something like below:
First Time Backup
After launching the Deja Dup, you will see two options namely Create My First Backup and Restore From a Previous Backup.
If it is the first time you start Deja Dup for the first time, obviously there won't be any backup. So let us create one. To do so, click Create My First Backup button.
When you select "Create My First Backup" option, it will take you through a few steps. As a first step, you have to set which directory to be backed up and which one to be excluded.
Take a look at the below image. There are two sections to include and exclude directories. According to your need, add or exclude directories. After choosing the directories to backup and the directories to exclude from the backup, click Forward button:
The next step will be to choose where you want to backup your data.
Currently, Deja Dup supports local, remote, or cloud backup locations like Google Drive. You can change the backup location at any time from the Preferences window.
For demonstration purpose, I am choosing a local directory as my backup location.
In the next screen, you will be asked to set a password for the backup. You can either use a password or no password. It is optional and completely up to you to decide.
This way you can encrypt the backup data. Encryption is done using
symmetric ciphers at the backend. All you have to do is provide a password and remember the password when you restore from the backup.
Now the backup will be started. If this is the first backup, the backup time may vary depending upon the size of the data. For me, Deja Dup took nearly 5 minutes to backup 8 GB directory.
These are the sequence of steps to be followed when you first schedule the backup. Backup is stored in an opaque format.
Schedule Backup with Deja Dup
Every backup utility has a feature to perform automatic incremental backups using cron job. Normally it will be done in Daily, Weekly, Monthly, and Yearly schedules.
Deja Dup uses different approach to backup though. Deja Dup schedules regular backups at specific intervals using a built-in program called "deja-dup-monitor".
You can use the following command to check the status of the
$ ps -ef | grep -i deja-dup-monitor
ostechnix 2234 1975 0 11:49 ? 00:00:00 /usr/libexec/deja-dup/deja-dup-monitor ostechnix 3696 3532 0 12:00 pts/0 00:00:00 grep --color=auto -i deja-dup-monitor
To enable automatic backups in Deja Dup, toggle the slider on under the Overview section:
There are only two backup schedules available. They are: Daily and Weekly.
To schedule backup, click the three vertical bars on the menu bar and click Preferences section.
Set backup schedule of your choice in the Automatic Backup Frequency drop-down box.
From now on, Deja Dup will automatically backup the data as per the backup frequency.
Please note that Deja Dup will initiate the backup process only when the user is logged in.
Restore Files from Backup with Deja Dup
Restoring data from the backup using Deja Dup is pretty easy. Deja Dup incrementally backs up, letting you restore from any particular backup at any time.
You can restore individual folders, files or entire backup. Make sure you have chosen the correct backup location in the "Storage" path from Preferences window.
To restore files, simply click the Restore button from the main interface. Deja Dup will automatically scan for the backup files and list them.
From the below image, you can see the list of files/folders available from my backup. Choose the file(s) or folders(s) you want to restore and hit the Restore button on the bottom left corner. If there are multiple backup copies you can choose from which date to restore the copy.
In this guide, we discussed what is Deja Dup and how to backup and restore files with Deja dup in Linux. Now it’s time for you to decide if this tool works for your scenario.
Deja Dup is a simple GUI application and is intended to be used on your personal system only. If you are looking for more advanced backup tools, you can try any one of the following tools:
Linux backup and synchronization applications:
- How To Backup Your Entire Linux System Using Rsync
- How To Backup Files And Directories Using Rsync In Linux
- How To Backup And Restore Linux System With Timeshift
- How To Setup Backup Server Using Rsnapshot
- How To Synchronize Files With Unison On Linux
- How To Synchronize Local And Remote Directories In Linux
- How To Synchronize Files And Directories Using Zaloha.sh
- CYA – System Snapshot And Restore Utility For Linux
- Restic – A Fast, Secure And Efficient Backup Application