Mar 15, 2007

UBUNTU Application: Revision-controlled home directories

Abstract
In Ubuntu.com said
Ubuntu should have home directories under revision control so users can go "back in time" to older versions of their documents. This should be easy to point at a central server, but default to the local machine. This would be similar to a feature in Apple's forthcoming OS X 10.5 "Leopard."
The Domain
  • Users have one home directory where are they files.
  • Users actions over files are create, delete and modify.
  • Mixing user actions over files we have hibrid actions, move, copy-paste, cut-paste (move like).
  • Directory, file, create,delete,modyfy, copy-paste, cut-paste and move are well know concepts

Scenario
A user make a tipical user error, like shift+del some files in nautilus, or rm * in a terminal. Ok, no problem, go back in time on my old home directory.

Desing Discuss myself
I see two ways to save the home directories states:
  • Dinamically: the daemon listen for any modifying action in the homes, when this happens, save a differential state.
  • Statically: With Time marks, something say when save a differential state ([ana]cron, user...)
The dinamically option is more powerfull, we can use something like inotyfy ( http://en.wikipedia.org/wiki/Inotify ) and the python bindings pyinotify ( http://pyinotify.sourceforge.net/ ). If a user decide to go back the program will show a calendar to select the date, next a list of versiĆ³n of the home directory or directories with an abstract of the changes.

The incremental backup systems is a good item to start, an efficient way is to use rsync, in http://rsync.samba.org/tech_report/tech_report.html, we have a full description.
We can get ideas from bazaar ( http://bazaar-vcs.org/BzrFeatures ).

By the moment, we speak about whole directories ¿Why if user want go back only for one document?. We should have this in mind.

Use Cases
For now, we only take care full directory restore. This is only a point to start.

0: User---> execute program
1: User---> Back to old home: Shows a calendar with marks of possibles "go back dates"
2: User---> Select a "go back date": Shows message "Are you sure?", List of changes an two options: yes or no;
3: User---> Select no: go back.
4: User---> Select yes: New windows with progress bar, call to Restore Process, set a time mark ($now)
5: User---> Set a time mark: Show nessage "You are goin to set a time mark on $now" options yes or no
6: User---> Select no: go back
7: User---> Select yes: New windows with progress bar, call to Set a Mark Process
8: Daemon --->Setup: save the state of the home directories separately, the date and a ID.
9: Daemon ---> Save the state of a home directory: save a differential state of a home directory
10: Daemon ---> get home state: give information about directory state indexed by ID and date

5, 6 and 7 are not necesary for dinamical option (see Desing discuss)
Possible security issues

We need autentificate the backup before restore and trust the connections .

Possible problems


The configuration files, solutions Ask, do nothig or downgrade.
System performance problems on filesystems events.

Contributtions

Thanks Soren Hansen advise me to look at inotify, pyinotify and bazzar .

2 comments:

Anonymous said...

hi.

Nice idea. I've several directories under SVN.

If would be great if you create a "--help" of the tool. That show what the people can do.

Buena suerte.

Sandip said...

Hi...I wud like to know what the status of your project "Revision controlled Home directories"....