Let’s face it, ensuring that you have regular backups of your home computer to a remote location can seem like a bit of a chore…right up to the time when you’ve managed to lose your data and need a fast and reliable way to get it back.
If you’re using Ubuntu, this task is made much easier by Deja Dup Backups.
Additionally, the cloud storage that comes free with mail accounts from most of the major tech companies can offer a reliable remote home for your backups until you need them. Handy when you don’t have a spare large-capacity thumb drive kicking around.
Using Ubuntu 24.04.02 LTS, what we’re going to look at here is :
Making your Google Drive accessible from the Ubuntu Gnome Desktop
Configuring Deja Dup to backup files to the Google Drive
Testing the backup
Scheduling backups to run regularly
For this purpose we’ll be using Ubuntu’s standard backup tool – Deja Dup ( listed as “Backups” if you need to search for it in the Gnome Application Menu).
We’ll also be making use of a Gmail account other than that used as the main account on an Android phone.
You may be relieved to know that we’ll be able to accomplish all of the above without opening a Terminal window ( well, not much anyway).
Accessing Google Drive from the Gnome Desktop
I’ve chosen to use a gmail account in this example because :
Google offers 15GB of free space compared to the 5GB you get with Microsoft or Apple
You don’t have to use the Google account you use for your Anrdoid phone so you don’t have to share the space with the phone data backups.
First you need to open Settings – either from the Gnome Application Menu, or from the Panel at the top of the screen – and select Online Accounts :
Now sign in with your Google account…
At this point you’ll be asked to specify what Gnome is allowed to access. In this case I’ve enabled everything :
If you now open Files on your computer, you should see your Google Drive listed :
In this case, I can also see that I have the full 15GB available :
Now we have a remote location to backup to, it’s time to figure out what to backup and how often…
Choosing what to Backup
OK, we’ve got some space, but it’s not unlimited so we want to take some care to ensure we backup only files we really need.
By default, the Backup tool will include everything under the current user’s $HOME apart from the Rubbish Bin and the Downloads folder :
Lurking under your $HOME are a number of hidden folders. In the main, these contain useful stuff such as application configuration ( e.g. web browser bookmarks etc). However, there may also be stuff that you really don’t need to keep hold of.
You remember what I said about not having to open a Terminal window ? Well, if you really want to know how big each of these directories is, You can just right-click each one in Files and then look at it’s properties. Alternatively, if you’re happy to open a Terminal Window, you can run :
This will output the total size of $HOME followed by the total size of each immediate child directory in descending order :
In this case, I can see that the whole of my home is a mere 80M so I’m not going to worry about excluding anything else from the backup for the moment.
One final point to consider. By default, Deja Dup encrypts backup files using GPG (Gnu Privacy Guard), which will compress files as well as encrypting them. This means that the actual space required for the backup may be considerably less than the current size on disk.
Configuring the Backup
Before we start, we’re going to create a test file so that we can make sure that our backup is working once we’ve configured it.
I’ve created a file in $HOME/Documents...
…which contains…
Now look for “Backups” in the Gnome Application Menu :
Open the tool and click on Create Your First Backup :
Next, we need to select which folders to backup. As mentioned above, Deja Dup uses a reasonably sensible default :
You can add folders to both the Folders to Back Up and Folders to Ignore lists by clicking on the appropriate “+” button and entering either an absolute path, or a relative path from your $HOME.
Next, we need to specify the destination for the backup.
Looks like Deja Dup has been clever enough to detect our mapped Google Drive :
The destination folder name default to the name of the current machine.
When the backup runs, the folder will be created automatically if it doesn’t already exist.
When we click the Forward button, Deja Dup may well ask for the installation of additional packages :
…before asking for access to your Google account :
The next screen asks for an Encryption password for your backup. A couple of important points to note here are :
Password protecting the backup is an outstandingly good idea. Whilst this screen does allow you to turn this off, I’d recommend against it – especially if the backup is being stored on a remote server.
Whilst you can ask Deja Dup to remember the password so that you won’t need it if you need to restore files from a backup on the current system, the password is essential if you want to restore the backed up files on another system…or the current system after some major disaster renders your existing settings unavailable. MAKE SURE YOU REMEMBER IT.
When we click Forward, we should now be running our first backup :
Once the backup completes, we’ll have the option to schedule them at regular intervals. First though, let’s take a look at the files that have been created :
Let’s make sure that we can restore files from this backup.
Click on the Restore tab in Deja Dup…
… and you should be able to see all of the files in our backup, including the test file we created earlier :
If we navigate to the Documents folder we can select files to restore :
Click on Restore and select the location to restore to ( in this case, we’ll put it directly into $HOME ) :
Again, Click Restore and you’ll get a confirmation that your file is back :
…which we can confirm in Files :
Scheduling Backups
Deja Dup can perform backups automatically at a set interval.
In the Overview tab, select Back Up Automatically.
If you then open the “hamburger” menu and select Preferences, you get additional options, namely :
Automated Backup Frequency
Keep Backups
Once you’ve configured them, these backups will take place automatically on the schedule you’ve specified.