Restoring files from backup

Restoring deleted files

There is no 'undelete' command in Linux. If you need to get a file back that you've accidentally deleted or overwritten, you need to restore it from backups.

Using tkrestore

The easiest way to restore from backups at CSE is to use the command tkrestore on the lab machines or login servers.

tkrestore is a graphical application, so if you're running it over PuTTY/SSH, you'll need to set up an X server on your computer.

Alternatively you can use vLab on your computer.

To get started:

  • Run tkrestore from the command line.
  • Select your username in the centre panel and click on Read Indices. This can take a while if there are a lot of files in your account.
  • The left panel shows you the files you can restore
  • Files with older versions available are flagged with a '+', and so are folders
    • Double-click '+' lists to expand or collapse the contents.
  • Entries are flagged with an 'i' for incremental backups, or 'f' for full backups (see next section).
  • Select the files/directories in the left panel that you want to restore, and click Add.

Once you've added the files you need:

  • Click Restore to restore your files.
  • The files will be restored into /home/YourUserName/Restored_Backup/source-date, where:
    • YourUsername is your username
    • source is either i or f depending on the backup source, and
    • date is the date on which the backup was taken.
  • Eg: /home/jbc/Restored_Backup/i-06.05.17/

Full vs Incremental backups

tkrestore can restore files from full backups and from nightly/weekly incremental backups.

Incremental backups

Incremental backups are taken nightly, and are kept on disk so can be restored in just a few seconds.

However, there are limits on total amount of files backed up nightly, and on the individual file size, so not all of your files will be there.

Also, you can't restore entire folders from incremental backups - you have to select the individual files you want.

Full backups

Your entire home directory - every single file - is backed up every month.

You can restore entire folders from the full backups - you don't need to select individual files (unless they're over 2GB in size).

However, full backups are kept on tape, which takes significantly more time to restore.

Recent full backups may still be in the tape library, and should be restored in less than an hour (often much less).

If your files are from older backups, the tapes may be in storage and need to be manually retrieved - this can take a day or more.

In any case, you will get a mail when the restoration is complete.

If you need help

If you're having any problems with any of this, contact System Support - we're more than happy to give you a hand.

Last edited by jbc 20/04/2020

Tags for this page:

backup, delete, restore, tkrestore