Backing Up Ubuntu

Tutorial: Miscellaneous

Introduction

Backups are incredibly important; they guard against your hard drive failing, or accidentally deleting an important file. In Ubuntu (and other linux distros that use gnome) we can use the built-in Backups application to backup to a remote network share (in Linux these are managed by Samba, in Windows they're just called network shares).

IMPORTANT:

Auto Mounting the Share

First we'll make certain you can access the samba share, get Ubuntu to remember your Samba username and password, and add a bookmark to the file browser so you can view the share outside of the backup utility.

  1. Open the file browser (nautilus)
  2. Click "Other Locations" in the bottom left
  3. Enter the server (e.g. smb://trichiliocosm/laptopdude) in the "Connect to Server" box
  4. Click "Connect"
  5. Choose "Connect As: Registered User"
  6. Enter your "Username" and "Password"
  7. Choose "Remember forever"
  8. Click "Connect"
  9. An entry should appear in the left pane like laptopdude on trichiliocosm
  10. Right-click on it then click "Add Bookmark"
  11. Optional: right-click on the new bookmark and "Rename..." it

Configuring Backups

By default, Ubuntu uses a program called Déjà Dup to run backups (which itself is a graphical interface for the program duplicity). It's easy to configure, and integrates with the file browser.

WARNING: In step 17, you have the option of entering an encryption password in the "Require Password?" dialog. The advantage of encryption is that whoever owns the remote Samba Share you're backing up to won't be able to read your data (without encryption they can). The disadvantage is that if you ever forget the encryption password, it will be impossible to restore the backup.

  1. Open the dash (button with the ubuntu logo in the top left) and search "Backups"
  2. Click the safe icon that appears
  3. Click "Folders to save" in the left panel
  4. Your home folder (e.g. Home (laptopdude)) should already be there
  5. Optional: use the + button in the bottom left to add more folders
  6. Click "Folders to ignore" in the left panel
  7. Click the + button in the bottom left
  8. Right click anywhere in the new file browser window and check "Show Hidden Files"
  9. Select .cache then click "Add" in the top left
  10. If these folders are present on your system, repeat steps 8 & 9 for these:
    • .PlayOnLinux
    • .steam
    • .wine
    • Games
    • snap
  11. Click "Storage Location" in the left pane
  12. Choose "Storage location: Network Server" in the drop-down
  13. Enter the server in "Network Location" (e.g. smb://trichiliocosm/laptopdude)
  14. Optional: change the destination "Folder" (e.g. backup/laptop)
  15. Click "Scheduling" in the left pane
  16. Toggle "Automatic backup" on
  17. A "Require Password?" dialog should appear (see WARNING above)
  18. If you don't want to encrypt, choose "Allow restoring without a password"
  19. Optional: enable encryption
    1. Choose "Password-protect your backup"
    2. Enter a good password in the 2 boxes
    3. Store the password in your Password Manager
    4. Check "Remember password"
  20. Click "Forward" in the top right
  21. Back in the "Scheduling" section of the main "Backups" window
  22. Optional: change "Every" to "Day"
  23. Optional: change "Keep" to "At least a year"
  24. Click "Overview" in the left pane
  25. The "Back Up Now..." button should be grayed out, meaning a backup is underway

Restoring a Deleted File

  1. Open the file browser
  2. Navigate to the folder where the file used to be
  3. Right-click on empty space (not on a file/folder icon)
  4. Choose "Restore Missing Files..." to get the "Restore" dialog
  5. Wait for the scan to find files (this could take many minutes)
  6. Check the files you want to recover
  7. Click "Forward" in the top right
  8. Click "Restore" in the top right
  9. Wait for the restore to finish (this could take many minutes)

Restoring a Previous Version of a File

  1. Open the file browser
  2. Navigate to the file
  3. Right-click on the file
  4. Choose "Revert to Previous Version..."
  5. Click "Forward" in the "Restore" dialog
  6. Wait for the scan to find backups (this could take many minutes)
  7. Choose the "Date" to restore from
  8. Click "Forward" in the top right
  9. Click "Restore" in the top right
  10. Wait for the restore to finish (this could take many minutes)

Restoring Everything

  1. Open the dash (button with the ubuntu logo in the top left) and search "Backups"
  2. Click the safe icon that appears
  3. Click "Overview" in the left pane if necessary
  4. Click "Restore..."
  5. Click "Forward" in the "Restore" dialog
  6. Wait for the scan to find backups (this could take many minutes)
  7. Choose the "Date" to restore from
  8. Click "Forward" in the top right
  9. Choose "Restore files to original locations" or "Restore to a specific folder"
  10. Optional: choose the destination folder for the restore
  11. Click "Forward" in the top right
  12. Click "Restore" in the top right
  13. Wait for the restore to finish (this could take hours)

Maintenance

About once a month, the Backups utility will prompt you to test your backups. This is very important to make certain everything is working in the event you actually need to recover files. You should always test your backups when prompted to do so.

Conclusion

Your computer will now backup weekly (or daily, if you chose that) to a remote server. Most people in the tech industry will say you need 2 separate remote backups to be truly safe, but this is a great start. The Backups utility will automatically delete old backups if you start to run out of space on the remote server, so you likely won't have to worry about that either, unless you're trying to backup lots of videos or games.