• Stars
    star
    971
  • Rank 47,138 (Top 1.0 %)
  • Language Vala
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

System restore tool for Linux. Creates filesystem snapshots using rsync+hardlinks, or BTRFS snapshots. Supports scheduled snapshots, multiple backup levels, and exclude filters. Snapshots can be restored while system is running or from Live CD/USB.

Timeshift

Timeshift for Linux 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.

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.

In BTRFS mode, snapshots are taken using the in-built features of the BTRFS filesystem. BTRFS snapshots are supported only on BTRFS systems having an Ubuntu-type subvolume layout (with @ and @home subvolumes).

Timeshift is similar to applications like rsnapshot, BackInTime and TimeVault but with different goals. It is designed to protect only system files and settings. User files such as documents, pictures and music are excluded. This ensures that your files remain unchanged when you restore your system to an earlier date. If you need a tool to back up your documents and files please take a look at the excellent BackInTime application which is more configurable and provides options for saving user files.

History

Timeshift was originally developed and maintained by Tony George.

His original repository is still available on Github.

Nowadays Timeshift is part of the Xapp project which is a collection of cross-DE and cross-distributions applications which are maintained by Linux Mint.

Features

Minimal Setup

  • Timeshift requires very little setup. Just install it, run it for the first time and take the first snapshot. Cron job can be enabled for taking automatic snapshots of the system at regular intervals. The backup levels can be selected from the Settings window.

  • Snapshots are saved by default on the system (root) partition in path /timeshift. Other linux partitions can also be selected. For best results the snapshots should be saved to an external (non-system) partition.

Multiple Snapshot Levels

  • Multiple levels of snapshots can be enabled - Hourly, Daily, Weekly, Monthly and Boot

  • Number of snapshots to retain can be specified for each level

  • Boot snapshots provide an additional level of backup and are created every time the system starts. Boot snapshots are created with a delay of 10 mins so that system startup is not affected.

  • Snapshots are tagged to indicate their time interval:

    • H: Hourly
    • D: Daily
    • W: Weekly
    • M: Monthly
    • B: Boot
    • O: On-demand (Manually created)

Rsync & BTRFS Snapshots

  • Supports rsync snapshots on all systems

  • Supports BTRFS snapshots on BTRFS systems

It is strongly recommended to use BTRFS snapshots on systems that are installed on BTRFS partition. BTRFS snapshots are perfect byte-for-byte copies of the system. Nothing is excluded. BTRFS snapshots can be created and restored in seconds, and have very low overhead in terms of disk space.

User Data is Excluded by Default

Timeshift is designed to protect system files and settings. It is NOT a backup tool and is not meant to protect user data. Entire contents of users' home directories are excluded by default. This has two advantages:

  • You don't need to worry about your documents getting overwritten when you restore a previous snapshot to recover the system.
  • Your music and video collection in your home directory will not waste space on the backup device.

You can selectively include items for backup from the Settings window. Selecting the option "Include hidden items" from the Users tab will back up and restore the .hidden files and directories in your home folder. These folders contain user-specific config files and can be included in snapshots if required.

Note: It is not recommended to include user data in backups as it will be overwritten when you restore the snapshot.

  • Unlike similar tools that are scheduled to 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 desktop users who keep their laptops and desktops switched on for few hours daily. Scheduling snapshots at a fixed time on such users will 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.
  • Applications like rsnapshot rotate a snapshot to the next level by creating a hard-linked copy. Creating a hard-linked copy may seem like a good idea but it is still a waste of disk space, since only files can be hard-linked and not directories. The duplicated directory structure can take up as much as 100 MB of space. Timeshift avoids this wastage by using tags for maintaining backup levels. Each snapshot will have only one copy on disk and is tagged as "daily", "monthly", etc. The snapshot location will have a set of folders for each backup level ("Monthly", "Daily", etc) with symbolic links pointing to the actual snapshots tagged with the level.

System Restore

  • Snapshots can be restored by selecting a snapshot from the main window and clicking Restore button on the toolbar.

  • Snapshots can be restored either from the running system (online restore) or from another system that has Timeshift installed on it (offline restore).

  • If the main system is not bootable, then it is possible to boot from an Ubuntu Live CD, install Timeshift on the live system, and restore a snapshot on the main system.

  • Restoring backups from the running system requires a reboot to complete the restore process.

Cross-Distribution Restore

  • You can also Timeshift across distributions. Let's say you are currently using Xubuntu and decide to try out Linux Mint. You install Linux Mint on your system and try it out for a week before deciding to go back to Xubuntu. Using Timeshift you can simply restore the last week's snapshot to get your Xubuntu system back. Timeshift will take care of things like reinstalling the bootloader and other details.
  • Since installing a new linux distribution also formats your root partition you need to save your snapshots on a separate linux partition for this to work.
  • It is recommended to include hidden items in home directory by selecting the option "Include Hidden Items" from Settings > Users.

Post Restore Hooks

  • Scripts can be run at the end of a restore job for anything that may need to be done prior to rebooting. The location for these scripts is /etc/timeshift/restore-hooks.d. Note: the script(s) will be run from the restored filesystem.

Supported System Configurations

  • Normal - OS installed on non-encrypted partitions

  • LUKS Encrypted - OS installed on LUKS-encrypted partitions

  • LVM2 - OS installed on LVM2 volumes (with or without LUKS)

  • BTRFS - OS installed on BTRFS volumes (with or without LUKS)

    • Only Ubuntu-type layouts with @ and @home subvolumes are supported

    • @ and @home subvolumes may be on same or different BTRFS volumes

    • @ may be on BTRFS volume and /home may be mounted on non-BTRFS partition

    • If swap files are used they should not be located in @ or @home and could instead be stored in their own subvolume, eg @swap

    • Other layouts are not supported

    • Make sure, that you have selected subvolume @ or /@ for root. You can check that executing script below, and if output is OK, then everything is alright.

      grep -E '^[^#].+/\s+btrfs' /etc/fstab | \
      grep -oE 'subvol=[^,]+' | \
      cut -d= -f2 | \
      grep -qE '^/?@$' && \
      echo 'OK' || \
      echo 'Not OK'
    • Default BTRFS subvolume must be /. You can make it using script below.

      MP="$(mktemp -d)"
      mount | awk '/on \/ type btrfs/{print $1}' | sudo xargs -I{} mount {} "$MP" && \
      sudo btrfs subvolume set-default 5 "$MP"; \
      sudo umount "$MP"
  • GRUB2 - Bootloader must be GRUB2. GRUB legacy and other bootloaders are not supported.

  • EFI - EFI systems are supported. Make sure that /boot/efi partition is selected for mounting before restoring snapshots (application will do it automatically).

  • Encrypted Home - For users with encrypted home, files in /home/.ecryptfs/$USER will be backed-up and restored. The decrypted contents in $HOME will be excluded. This avoids the security risk of decrypted contents becoming available outside the user's home directory.

  • Encrypted Private Directory - For users with encrypted Private directory, the encrypted files in $HOME/.Private, as well as the decrypted files in $HOME/Private, will be excluded (as it contains user data). Filters added by user to include files from $HOME/.Private or $HOME/Private will be ignored.

  • Docker & Containers - Docker and containerized systems are not supported. Running Timeshift on such systems will have unpredictable results.

Installation

Debian-based Distributions

Debian, Ubuntu, Linux Mint, Elementary OS, etc.

Install Timeshift from the repositories:

sudo apt-get update
sudo apt-get install timeshift

Or build and install timeshift from the source code:

sudo apt install make gettext valac libvte-2.91-dev libgee-0.8-dev libjson-glib-dev
make
sudo make install

Fedora

Fedora is not fully supported. BTRFS snapshots only support Ubuntu-specific layouts.

sudo dnf update
sudo dnf install timeshift

Arch

sudo pacman -S timeshift

Removal

Run the following command in a terminal window:

sudo apt-get remove timeshift

or

sudo dnf remove timeshift

or

sudo pacman -R timeshift

depending in your package management system.

Remember to delete all snapshots before un-installing. Otherwise the snapshots continue to occupy space on your system. To delete all snapshots, run the application, select all snapshots from the list (CTRL+A) and click the Delete button on the toolbar. This will delete all snapshots and remove the /timeshift folder in the root directory.

Known Issues & Limitations

BTRFS volumes

BTRFS volumes must have an Ubuntu-type layout with @ and @home subvolumes. Other layouts are not supported. Systems having the @ subvolume and having /home on a non-BTRFS partition are also supported.

Text file busy / btrfs returned an error: 256 / Failed to create snapshot can occur if you have a Linux swapfile mounted within the @ or @home subvolumes which prevents snapshot from succeeding. Relocate the swapfile out of @ or *@home, for example into it's own subvolume like @swap.

Disk Space

Timeshift requires a lot of disk space to keep snapshot data. The device selected as snapshot device must have sufficient free space to store the snapshots that will be created.

If the backup device is running out of space, try the following steps:

  • Reduce the number of backup levels - Uncheck the backup levels and keep only one selected
  • Reduce the number of snapshots that are kept - In the Schedule tab set the number of snapshots to 5 or less.
  • You can also disable scheduled snapshots completely and create snapshots manually when required

Bootloader & EFI

  • Only those systems are supported which use GRUB2 bootloader. Trying to create and restore snapshots on a system using older versions of GRUB will result in a non-bootable system.
  • EFI systems are fully supported. Ensure that the /boot/efi partition is mapped while restoring a snapshot. It will be mapped automatically if detected.
  • If you are restoring from Live CD/USB, and your installed system uses EFI mode, then you must boot from Live CD/USB in EFI mode.

Contribute

You can contribute to this project in various ways:

  • Submitting ideas, and reporting issues in the tracker
  • Translating this application to other languages in Launchpad
  • Contributing code changes by fixing issues and submitting a pull request (do not modify translations, this is done in Launchpad)
  • To get started with coding, see the development docs

More Repositories

1

cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
JavaScript
4,196
star
2

nemo

File browser for Cinnamon
C
1,046
star
3

warpinator

Share files across the LAN
Python
959
star
4

hypnotix

An M3U IPTV Player
Python
865
star
5

cinnamon-spices-applets

Applets for the Cinnamon desktop
JavaScript
526
star
6

webapp-manager

Python
501
star
7

xed

X-Apps [Text] Editor (Cross-DE, backward-compatible, GTK3, traditional UI)
C
392
star
8

nemo-extensions

A set of extensions for Nemo
C
374
star
9

slick-greeter

A slick-looking LightDM greeter
Vala
308
star
10

mintupdate

The Linux Mint Update Manager
Python
267
star
11

mint-themes

Mint-X, Mint-Y..
CSS
190
star
12

sticky

A sticky notes app for the linux desktop
Python
186
star
13

muffin

The window management library for the Cinnamon desktop (libmuffin) and its sample WM binary (muffin)
C
186
star
14

xreader

A generic Document Reader
C
184
star
15

cinnamon-desktop

The cinnamon-desktop library (and common settings schemas for the cinnamon desktop)
C
173
star
16

pix

Image management application
C
172
star
17

cinnamon-screensaver

The Cinnamon screen locker and screensaver program
Python
144
star
18

cinnamon-spices-themes

Themes for the Cinnamon desktop
CSS
139
star
19

mintstick

Python
131
star
20

blueberry

A Bluetooth configuration tool
Python
126
star
21

mintinstall

Software Manager
Python
119
star
22

cinnamon-spices-desklets

Desklets for the Cinnamon desktop
JavaScript
116
star
23

mint-y-icons

The Mint-Y icon theme
Python
100
star
24

mdm

The MDM Display Manager
C
94
star
25

cinnamon-spices-extensions

Extensions for the Cinnamon desktop
JavaScript
93
star
26

lightdm-settings

A configuration tool for the LightDM display manager
Python
92
star
27

mintmenu

Advanced Mint menu for MATE
Python
86
star
28

xplayer

A generic Media Player
C
81
star
29

xapp

Cross-desktop libraries and common resources
C
75
star
30

bulky

Bulk Renamer
Python
73
star
31

mint-y-theme

This is an old repository, please check https://github.com/linuxmint/mint-themes instead.
CSS
71
star
32

xviewer

A generic Image viewer
C
66
star
33

cjs

The Cinnamon Javascript interpreter
C++
65
star
34

mintwelcome

Welcome screen
Python
64
star
35

cinnamon-control-center

A collection of configuration plugins used in cinnamon-settings
C
63
star
36

website-wizixo

CSS
59
star
37

cinnamon-settings-daemon

The settings daemon for the Cinnamon desktop
C
56
star
38

mintdrivers

Driver Manager
Python
54
star
39

live-installer

A live installer for the Debian edition
HTML
53
star
40

mintbackup

The mintBackup Backup Tool
Python
52
star
41

mint-x-icons

Icon theme for Linux Mint
Python
51
star
42

mintsystem

Python
51
star
43

mintdesktop

Desktop configuration tool for MATE and Xfce
Python
51
star
44

mintsources

Python
50
star
45

linuxmint

Linux Mint
48
star
46

mint4win

Windows installer for Linux Mint based on Wubi
C++
44
star
47

ubiquity

Installer
Python
43
star
48

mate

MATE Debian Packages (please report bugs either to MATE or Linux Mint directly)
Python
39
star
49

pia-manager

A VPN configuration tool for PIA
Python
31
star
50

mintupgrade

Python
31
star
51

nvidia-prime-applet

Python
29
star
52

mintnanny

Domain blocker
Python
29
star
53

xapp-thumbnailers

Thumbnailers for GTK Desktop Environments
Python
27
star
54

cinnamon-session

The Cinnamon session manager
C
25
star
55

thingy

Library - Recent and favorite documents
Python
25
star
56

cinnamon-menus

The cinnamon-menu library
C
24
star
57

gtk

GTK toolkit for Betsy (master) and Mint 17.
C
22
star
58

mint-dev-tools

Python
21
star
59

mint20-beta

BETA Bug Squah Rush
21
star
60

doc-user-guide

The Linux Mint User Guide
Python
20
star
61

mintcommon

Python
20
star
62

doc-developer-guide

The Linux Mint Developer Guide
20
star
63

mintupgrade-legacy

Tool to upgrade from one LTS to another.
Python
20
star
64

gdebi

Pinned version of gdebi in Mint 18.x
Python
19
star
65

cinnamon-translations

Makefile
18
star
66

python3-xapp

Python3 Xapp Library
Python
17
star
67

mint-themes-gtk3

CSS
16
star
68

folder-color-switcher

Python
16
star
69

mint21-beta

BETA Bug Squash Rush
16
star
70

mintreport

Troubleshooting tool
Python
16
star
71

mintupload

Uploads files on the Internet
Python
16
star
72

mintlocale

Python
14
star
73

doc-troubleshooting-guide

The Linux Mint Troubleshooting Guide
Python
12
star
74

flags

Source package for iso-flag-png
12
star
75

cinnamon-themes

This is an old repository, please check https://github.com/linuxmint/mint-themes instead.
CSS
12
star
76

brand-logo

Linux Mint Logo and brand resources
11
star
77

mint19.3-beta

BETA Bug Squah Rush
10
star
78

wine-installer

Meta package and missing files for Wine
10
star
79

mint-translations

Python
10
star
80

mint20.1-beta

BETA Bug Squah Rush
9
star
81

mint21.2-beta

BETA Bug Squash Rush
9
star
82

mint-mdm-themes

JavaScript
9
star
83

xfce-panel

C
8
star
84

linuxmint.github.io

This is the content of https://projects.linuxmint.com
HTML
8
star
85

ubuntu-drivers-common

Python
8
star
86

xfce4-xapp-status-plugin

XappStatus panel applet for Xfce4
C
8
star
87

xviewer-plugins

C
8
star
88

gnome-screenshot

Patched version for Linux Mint 18, and 19.
C
7
star
89

mint20.3-beta

BETA Bug Squah Rush
7
star
90

libreoffice-style-mint

Icons for LibreOffice
7
star
91

cinnamon-bluetooth

No longer used. Please check blueberry instead.
Shell
7
star
92

mint-l-theme

Mint-L Theme
CSS
7
star
93

apturl

Python
7
star
94

mint-y-colors

Temporary project to work on colors
Python
7
star
95

mint21.1-beta

BETA Bug Squash Rush
7
star
96

libappindicator

Patched version of libappindicator (falls back to XAppStatusIcon instead of GtkStatusIcon)
C
6
star
97

xplayer-plparser

C
6
star
98

mint-upgrade-info

Metadata used to upgrade from one minor release to the next
6
star
99

lmde6-beta

BETA Bug Squash Rush
6
star
100

doc-translation-guide

The Linux Mint Translation Guide
6
star