Timeshift

From PCLinuxOSHelp Knowledge Base
Jump to: navigation, search

Timeshift is an application that provides functionality similar to the System Restore feature in Windows and the Time Machine tool in Mac OS. Timeshift protects your system by taking incremental snapshots of the file system at regular intervals. These snapshots can be restored at a later date to undo all changes to the system. Timeshift is designed to protect only system files and settings User files such as documents, pictures and music are excluded. This ensures that your user files remain unchanged when you restore your system to an earlier date.

Installing and running Timeshift

If not already installed on your system then search in Synaptic for timeshift to install Timeshift and its dependencies. Once installed you will find it on the start menu under Archiving->Timeshift. You will be prompted for the root password. Enter the root password to continue and you will then see the main Timeshift window.

TimeShift-1.png

At this point nothing is configured and so the first thing to do is click the Wizard button on the toolbar which will walk you through the process of configuring Timeshift snapshots. Timemshift just needs 3 pieces of information: The snapshot type, the location to store the snapshots and optionally a schedule for taking snapshots.

On the first screen you choose the type of snapshot. Most users should select RSYNC as the snapshot type. In RSYNC mode, snapshots are taken using rsync and hard-links. Common files are shared between snapshots which saves disk space. Each snapshot is a full system backup that can be browsed with a file manager.

TimeShift-2.png

Next Timeshift will estimate the amount of free space required for creating snapshots and then display a list of disks and partitions available on the system. You can store your snapshots on your main system drive/partition if you wish but if you want to treat your Timeshift snapshots as normal system backups you should choose a partition on a non-system (external) drive. Timeshift will store the snapshots under /timeshift on the selected partition.

TimeShift-3.png

Timeshift will warn if there is not enough free space available on the selected partition. If you only wish to take snapshots manually then you can click Finish at this point and Timeshift configuration is complete. On the other hand if you want snapshots taken regularly then click Next

IconNote.png
Note:
Snapshots can use a lot of disk space so make sure you choose a partition with plenty of free space


The next screen enables you to choose a schedule for creating snapshots. Here you choose the frequency of the snapshots and the number of snapshots to keep. So on the screen below a snapshot is taken every week and we keep 2 snapshots which means we have the option of rolling back to last week or the week before.

TimeShift-4.png

The Boot option takes a snapshot after each reboot (after a delay of 10 minutes in order not to slow down the start up).

You can choose not to have scheduled snapshots by unticking all the options. In that case you would create snapshots yourself by clicking the Create button on the toolbar, perhaps before doing a system update.

The next screen controls whether the contents of user home directories are included or not. As explained earlier, Timeshift is designed to protect only system files and settings and so this should left to Exclude All Files. If user directories were to be included the size of snapshots could quickly get out of hand.

TimeShift-5.png

You can now click Next or Finish. Either way the setup is complete and you will be returned to the main screen. If you configured scheduled snapshots then the current status will be shown at the bottom of the window.

TimeShift-6.png

You can change any of the settings by clicking the Settings button on the toolbar.

That is all that is needed to set up Timeshift and you can now close the Timeshift window. If you have enabled scheduled backups then within the next hour or so Timeshift will create the first snapshot. Unlike similar tools that take backups at a fixed time of the day, Timeshift is designed to run once every hour and take snapshots only when a snapshot is due. This is more suitable for users who only have their systems switched on for few hours daily. Scheduling snapshots at a fixed time would result in missed backups since the system may not be running when the snapshot is scheduled to run. By running once every hour and creating snapshots when due, Timeshift ensures that backups are not missed.

TimeShift-7.png

The window lists the available snapshots. The system can be restored back the time of a snapshot by clicking a snapshot in the window and clicking the Restore button on the toolbar. Snapshots can be restored either from the running system (online restore) or from LiveCD/USB if the system is not bootable. Restoring snapshots from the running system requires a reboot to complete the restore process.

IconNote.png
Note:
Only systems which use the GRUB2 bootloader are supported



Restoring snapshots

The system can be restored back the time of a snapshot by clicking a snapshot in the window and clicking the Restore button on the toolbar. Snapshots can be restored either from the running system (online restore) or from LiveCD/USB if the system is not bootable. Restoring snapshots from the running system requires a reboot to complete the restore process.

TimeShift-8.png

This window shows the disk configuration as it was when the snapshot was taken. There is usually no need to change anything here unless you want to restore to different partitions. Click Next and then Timeshift will examine the chosen snapshot to produce a list of files which have changed since the snapshot was taken

TimeShift-9.png

Click Next and you will get one final confirmation screen before the restore actually takes place.

Restoring snapshots using a LiveCD/USB

If you are unable to boot your system you can still restore snapshots by booting a LiveCD/USB and running Timeshift from there.

IconNote.png
Note:
If restoring from a LiveCD/USB you must boot the Live media in the correct mode (Legacy or UEFI) for the installed system


If TimeShift is not installed on the LiveCD/USB then you can install it in the normal way using Synaptic. When you run Timeshift in this way it automatically runs in Live USB mode and only restore functions are available.

Before you can restore you will need to run the configuration wizard by clicking the Wizard button on the toolbar. Then on the Select Snapshot Location screen you should choose the partition where your snapshots are stored and then click Finish. You should then see the available snapshots in the main window and you can continue with Restore as detailed in the previous section.

TimeShift-10.png