Time Machine

Registered by Sergey "Shnatsel" Davidoff

Make it possible to view previous versions of files, a-la "time machine". It should be integrated into apps etc etc

Blueprint information

Status:
Complete
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Approved
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Needs Infrastructure
Milestone target:
None
Started by
Cody Garver
Completed by
Cody Garver

Related branches

Sprints

Whiteboard

Possible solutions:
 * NILFS2 - continuously snapshotting filesystem http://www.nilfs.org/en/
 * BTRFS snapshots (almost like shadow copies in windows) + it seems to have more elaborate file history under the hood, but doesn't seem to expose it
 * Home folder is a git repository (with some tweaks for better performance on binaries)
 * Cronopete - written in Vala and the author is willing to collab with us! (http://www.rastersoft.com/programas/cronopete.html)

After learning more about BTRFS on-disk format, I discovered that it stores old versions of files automatically even if you don't take a snapshot; those versions are stored on disk for as long as the amount of free space on the disk permits. This is VERY close to what we need! If there just were a tool to list and access all existing versions of a particular file, the problem would be solved. ~shnatsel

Sergio is working on Cronopete as a backup solution. From what I understand, it could make use of btrfs snapshots. Targeted to Luna +1 and we'll discuss it with him then --DanRabbit

It should be very user friendly and easy to use just like time machine.
Unfortunately even time machine has disadvantages.
So here are my suggestions for a good backup solution:

* The backup should be bootable.
* We're dealing with user data so it should be encrypted.
* The first time the copy should be a full backup but then only differences (incremental backup) should be recorded.
* Support multiple saving locations harddisk, external device, network shares and cloud storage (dropbox).
* Easy changeable backup schedules.
* The system performance shouldn't be degraded too much while doing a backup.
* Backups should be compressed to save disk space.
* Restore the backups. -- swizzle

How would this be integrated into Files? --Alex

The choice of data encryption is given at installation time, so i don't think further questioning is useful. Also why make backup versions of system files? Upgrading should be secure beforehand. Only backup /home .
(The reason to backup the complete filesystem is to restore your computer easily, including packages, applications and other system configurations such as drivers and internet passwords) -- optimisme
So let's give the user the choice to activate or not this feature at installation time. What name we give to it? Something of instant comprehension, like "File Snapshot". ~sal-merone

The encryption used by the system works on a volumes under the level of file systems. If you do want to backup and encrypt files and their changes you have to do it above the file system level. And here's a link to btrfs snapshots from the official wiki https://btrfs.wiki.kernel.org/index.php/FAQ#What_is_a_snapshot.3F -- Simon

And what about Deja Dup? We could use libdeja (http://bazaar.launchpad.net/~deja-dup-hackers/deja-dup/30/files/head:/libdeja/) and make a frontend to Switchboard, it would be so easy to start and has a numerous adventajes. DejaDup has diffs, encryptation, compress and a good way to be launched periodically. In addition, it is developed in Vala, so this distro would keep its own consistency. Also it would need the Files plugin to grant a direct access. -- Javier Delgado.

Extra info on NILFS:
* INFO: The use of copy-on-write is "exploited" by NILFS to keep previous the file value whenever you write to it. NILFS has continuous checkpoints. For every disk write there's a checkpoint.
* INFO: Checkpoints are garbage collected periodically (fixed interval that you can set) or whenever space is running low.
* PROS: Any checkpoint can be turned into a snapshot which is a "permanent" checkpoint meaning that it's not garbage collected. Snapshots *can be mouted* as a (read-only) filesystem. You can revert the FS to a certain snapshot.
* CONS: Can't merge snapshots. Copy-on-write with retention uses up double the space (no file diff storage, no compression). You can't merge snapshots to get the best of two previous states.
-- Mihai Stancu

New proposal: etckeeper, it uses the apt-get hooks to make sure your /etc folder gets automatic git versioning whenever you install/uninstall something. Alongside a git repo for the homedir.
* CONS: the binary deltas or lackthereof
-- Mihai Stancu

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.