Pages

Monday, February 10, 2014

Adding Deja-dup support to Pantheon !

Today I needed to restore some files from backup. I keep a running six months worth of my users home directory on a external portable SATA drive. This works well for me as I have in the past switched between using Ubuntu's Unity desktop as well as Gnome 3 and now ElementaryOS. I think I'm going to stick with Elementary for awhile as I love their design philosophy, simple is better. For backups my tool of choice is Deja-Dup. I love this tool as it too is simple to use and can also be used from both the GUI and commandline which means Integrating into file managers is much easier. My memory is not so good anymore so remembering commands at the commandline has been trumped by clicking on a file or directory and selecting restore. So in order to integrate Deja-Dup into Pantheon file manager all you have to do is create two files. One for restoring missing files from a directory and the other for revert to a previous version of a file.

So the first file we'll create is dejadup-restore.contract. This file needs to be created in the directory /usr/share/contractor. You'll need Admin permissions to write to this location. So use your favorite editor and create the file and put the following contents into the file.

[Contractor Entry]
Name=Restore missing files in folder
Icon=edit-find
Description=Restores missing files in folder using dejadup
MimeType=inode/directory
Exec=deja-dup --restore-missing %U
Gettext-Domain=deja-dup

Save and exit editing

Next lets create the file dejadup-revert.contract in the same way that you created the first file. Put the following contents into this file.

[Contractor Entry]
Name=Revert to previous version...
Description=Revert to a previous version
Icon=edit-find
MimeType=application/octet-stream
Exec=deja-dup --restore %U
Gettext-Domain=deja-dup

Save and exit editing.
Close Pantheon and reopen it. Right click on a file or directory and select either Restore or Revert to see your newly create Deja-Dup integration.

Happy restoring!


No comments:

Post a Comment