This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Build a plugin for backup service?

Tags: None
(comma "," separated)
bonassis
Registered Member
Posts
59
Karma
0
OS

Build a plugin for backup service?

Tue Feb 24, 2015 4:26 pm
Hi,

I'm working on a backup service, which provides easy access to previous versions of files.
It's using a FUSE filesystem for that. To maintain the versions btrfs is used.

For example, the directory /home/sbon/Projects/fuse/fuse-backup has been selected to backup.
This results in a directory like:

/srv/backupbtrfs/mount/home/sbon/Projects/fuse/fuse-backup

where the contents looks like:

sbon [ /srv/backupbtrfs/mount/home/sbon/Projects/fuse/fuse-backup ]$ ls -al
total 38
drwxr-xr-x 74 sbon users 4096 Feb 23 23:19 .
drwxr-xr-x 1 sbon users 4096 Jan 30 09:22 ..
drwxr-xr-x 2 sbon users 1 Jan 7 2013 AUTHORS
drwxr-xr-x 2 sbon users 2 Feb 12 00:18 backupjobs-base.c
drwxr-xr-x 2 sbon users 2 Feb 19 17:16 backupjobs-base.h
drwxr-xr-x 2 sbon users 3 Feb 20 07:28 backupjobs.c
drwxr-xr-x 2 sbon users 3 Feb 19 17:40 backupjobs-fsevent.c
drwxr-xr-x 2 sbon users 1 Feb 5 10:47 backupjobs-fsevent.h
drwxr-xr-x 2 sbon users 3 Feb 20 07:28 backupjobs.h
drwxr-xr-x 2 sbon users 2 Feb 13 16:50 backupjobs-util.c
drwxr-xr-x 2 sbon users 2 Feb 13 16:49 backupjobs-util.h
drwxr-xr-x 2 sbon users 2 Feb 12 00:28 backup-stat.c
drwxr-xr-x 2 sbon users 1 Jan 22 00:29 backup-stat.h
drwxr-xr-x 2 sbon users 3 Feb 15 23:45 backupsync.c
drwxr-xr-x 2 sbon users 1 Feb 1 23:58 backupsync.h
drwxr-xr-x 2 sbon users 1 Nov 18 17:28 config.h
drwxr-xr-x 2 sbon users 1 Feb 7 19:39 config.h.in
drwxr-xr-x 2 sbon users 2 Feb 14 10:34 db-mysql-base.c
drwxr-xr-x 2 sbon users 2 Feb 14 12:35 db-mysql-base.h
..... more directories ......

In the FUSE fs files are represented as directories. This is because this directory can then contain the versions of this file.
For example the "file" backupjobs.c has three versions like:

sbon [ /srv/backupbtrfs/mount/home/sbon/Projects/fuse/fuse-backup ]$ ls -al backupjobs.c
total 12
drwxr-xr-x 2 sbon users 3 Feb 24 17:09 .
drwxr-xr-x 74 sbon users 4096 Feb 23 23:19 ..
-rw-r--r-- 1 sbon users 25838 Feb 13 10:10 201502141034
-rw-r--r-- 1 sbon users 26725 Feb 19 23:55 201502200852
-rw-r--r-- 1 sbon users 26243 Feb 20 07:28 201502241058

where the number 201502141034 is the code for the usersession .

Now this service runs in the background, and provides a FUSE fs to give easy access to the
backups and their versions. I'm planning to work on a project website on github, and have a qt5 gui
to edit backupjobs.

Now it would be very very nice to integrate this into Dolphin:
- provide a "Backup" action in the rightclick menu. When clicked on with a directory which has not been selected before
for backup the gui for managing the backupjobs is presented.
When clicked on a with a file which is in a directory which has been selected before for backup Dolphin can show the versions
of this file in a userfriendly way. It would be very nice to show the differences in an userfriendly way,
and offer the ability torestore a previous version.

What is your opinion? Are you interested? I want to work on a plugin or extension for Dolphin, but of course before doing so
I want to know how others look at it.

(my goal with this software is to give the user very easy access to backups and previous versions of files, just with one or tow clicks.
there is much more backup software available, but they aways require a lot of effort to get the backup of the file you're looking for)

My planning is to give a presentation at the OpenSuse conference here in Den Hage, May 2015.

Stef Bon
freininghaus
Moderator
Posts
224
Karma
1
OS
Your idea sounds interesting!

Note that you can create context menu plugins easily on your own - you don't need the agreement of Dolphin developers (or anyone else) to do it. Most actions in the context menu are provided by external plugins which are found by Dolphin (and FolderView, Konqueror and anything else in KDE that can be used for file management) automatically at run time.

If you are looking for feedback from others concerning the details of the user interface, maybe you coult try to post in the "Brainstorm" section of the KDE forums.
bonassis
Registered Member
Posts
59
Karma
0
OS
Thank you for your positive response. Happy to get positive feedback.

I know I can create right click menu items just like that, but my idea is more than that. I want to make Dolphin show versions of a file. This requires adjustments in the code of Dolphin as far as I can see it.

Posting at the brainstorm page is also a good idea.

Stef
freininghaus
Moderator
Posts
224
Karma
1
OS
If you want to allow the user to work with different versions of files, maybe the version control interface might be useful for you. You might want to have a look at the version control plugins which can be found in this repository: http://quickgit.kde.org/?p=dolphin-plugins.git

Maybe you can use some of the code there to create a plugin that interacts with your backup service.
bonassis
Registered Member
Posts
59
Karma
0
OS
Aha thanks! I will check that out. I first look at it says that it looks good, but a lot of work has to be done.

Stef
bonassis
Registered Member
Posts
59
Karma
0
OS
Hi,

I've posted on the brainstorm page, but no reaction yet.

Maybe somebody here has an idea:

how does the dolphin plugins api work? How can I write a new plugin for my backupservice?

Stef


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, mesutakcan, sandyvee, Sogou [Bot]