All of lore.kernel.org
 help / color / mirror / Atom feed
* Plans for a library for btrfs?
@ 2015-05-27 12:31 Stef Bon
  2015-05-27 17:39 ` Duncan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stef Bon @ 2015-05-27 12:31 UTC (permalink / raw)
  To: Btrfs BTRFS

Hi,

I'm working on a program (using sqlite, FUSE and btrfs) to provide
backup and version managment
for users. They can enable the backup service for folders they own,
and select files they want to backup using mimetypes.

This program, which I've called fuse-backup, creates backup subvolumes
and snapshots by calling an extrenal script, which does something
like:

btrfs subvolume snapshot -r %PathToBackup%/ %PathToSnapshot%

This works perfect, but are there any plans to do this with a library?

Stef Bon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Plans for a library for btrfs?
  2015-05-27 12:31 Plans for a library for btrfs? Stef Bon
@ 2015-05-27 17:39 ` Duncan
  2015-05-29 14:04   ` David Sterba
  2015-05-29 14:31 ` Roman Mamedov
  2015-05-29 19:13 ` Juan Orti Alcaine
  2 siblings, 1 reply; 6+ messages in thread
From: Duncan @ 2015-05-27 17:39 UTC (permalink / raw)
  To: linux-btrfs

Stef Bon posted on Wed, 27 May 2015 14:31:28 +0200 as excerpted:

> I'm working on a program (using sqlite, FUSE and btrfs) to provide
> backup and version managment for users. They can enable the backup
> service for folders they own, and select files they want to backup using
> mimetypes.
> 
> This program, which I've called fuse-backup, creates backup subvolumes
> and snapshots by calling an extrenal script, which does something like:
> 
> btrfs subvolume snapshot -r %PathToBackup%/ %PathToSnapshot%
> 
> This works perfect, but are there any plans to do this with a library?

A library is covered on the wiki, project ideas page.

https://btrfs.wiki.kernel.org/index.php/Project_ideas#Provide_a_library_covering_.27btrfs.27_functionality

Status: Project not claimed, no patches, but there's a couple possible 
places to start as parts of other projects.  See the link for more.





-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Plans for a library for btrfs?
  2015-05-27 17:39 ` Duncan
@ 2015-05-29 14:04   ` David Sterba
  0 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2015-05-29 14:04 UTC (permalink / raw)
  To: Duncan; +Cc: linux-btrfs

On Wed, May 27, 2015 at 05:39:34PM +0000, Duncan wrote:
> Stef Bon posted on Wed, 27 May 2015 14:31:28 +0200 as excerpted:
> 
> > I'm working on a program (using sqlite, FUSE and btrfs) to provide
> > backup and version managment for users. They can enable the backup
> > service for folders they own, and select files they want to backup using
> > mimetypes.
> > 
> > This program, which I've called fuse-backup, creates backup subvolumes
> > and snapshots by calling an extrenal script, which does something like:
> > 
> > btrfs subvolume snapshot -r %PathToBackup%/ %PathToSnapshot%
> > 
> > This works perfect, but are there any plans to do this with a library?
> 
> A library is covered on the wiki, project ideas page.
> 
> https://btrfs.wiki.kernel.org/index.php/Project_ideas#Provide_a_library_covering_.27btrfs.27_functionality
> 
> Status: Project not claimed, no patches, but there's a couple possible 
> places to start as parts of other projects.  See the link for more.

AFAIK Karel Zak started working on libbtrfs.

https://github.com/karelzak/btrfs-progs/tree/libbtrfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Plans for a library for btrfs?
  2015-05-27 12:31 Plans for a library for btrfs? Stef Bon
  2015-05-27 17:39 ` Duncan
@ 2015-05-29 14:31 ` Roman Mamedov
  2015-05-29 17:02   ` Goffredo Baroncelli
  2015-05-29 19:13 ` Juan Orti Alcaine
  2 siblings, 1 reply; 6+ messages in thread
From: Roman Mamedov @ 2015-05-29 14:31 UTC (permalink / raw)
  To: Stef Bon; +Cc: Btrfs BTRFS

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On Wed, 27 May 2015 14:31:28 +0200
Stef Bon <stefbon@gmail.com> wrote:

> This program, which I've called fuse-backup, creates backup subvolumes
> and snapshots by calling an extrenal script, which does something
> like:
> 
> btrfs subvolume snapshot -r %PathToBackup%/ %PathToSnapshot%
> 
> This works perfect, but are there any plans to do this with a library?

If this works perfect, then what is the rationale for needing a library?
Do you see a clear reason aside from any vague "it's supposed to be that way".
In the Unix land it is perfectly normal for programs to call other
self-contained programs to do their self-contained jobs:
http://www.catb.org/esr/writings/taoup/html/ch01s06.html#id2877684
Not everything must to be a library linked into your main executable, some
separation and calling external programs to do stuff such as mkfs or snapshot
management seems perfectly fine and even better from the debug-ability
standpoint.

-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Plans for a library for btrfs?
  2015-05-29 14:31 ` Roman Mamedov
@ 2015-05-29 17:02   ` Goffredo Baroncelli
  0 siblings, 0 replies; 6+ messages in thread
From: Goffredo Baroncelli @ 2015-05-29 17:02 UTC (permalink / raw)
  To: Roman Mamedov, Stef Bon; +Cc: Btrfs BTRFS

On 2015-05-29 16:31, Roman Mamedov wrote:
> On Wed, 27 May 2015 14:31:28 +0200
> Stef Bon <stefbon@gmail.com> wrote:
> 
>> This program, which I've called fuse-backup, creates backup subvolumes
>> and snapshots by calling an extrenal script, which does something
>> like:
>>
>> btrfs subvolume snapshot -r %PathToBackup%/ %PathToSnapshot%
>>
>> This works perfect, but are there any plans to do this with a library?
> 
> If this works perfect, then what is the rationale for needing a library?

The problem in calling another executable, is that is very difficult to parse the program output.
For "btrfs sub snap" it is easy; but what about "btrfs fi df" or "btrfs fi show" ?

> Do you see a clear reason aside from any vague "it's supposed to be that way".
> In the Unix land it is perfectly normal for programs to call other
> self-contained programs to do their self-contained jobs:

Right, but now btrfs is a collection of tools; I don't think that it could e considered a "self-contained programs"... Other programs (eg systemd, udev) rewrite some code in order to avoid to call an external executable. This leads to code duplication with all the associated problems...

> http://www.catb.org/esr/writings/taoup/html/ch01s06.html#id2877684
> Not everything must to be a library linked into your main executable, some
> separation and calling external programs to do stuff such as mkfs or snapshot
> management seems perfectly fine and even better from the debug-ability
> standpoint.





-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Plans for a library for btrfs?
  2015-05-27 12:31 Plans for a library for btrfs? Stef Bon
  2015-05-27 17:39 ` Duncan
  2015-05-29 14:31 ` Roman Mamedov
@ 2015-05-29 19:13 ` Juan Orti Alcaine
  2 siblings, 0 replies; 6+ messages in thread
From: Juan Orti Alcaine @ 2015-05-29 19:13 UTC (permalink / raw)
  To: Stef Bon; +Cc: Btrfs BTRFS

I'm not a developer, but I read this a days ago. Could it be helpful?

https://blog-vpodzime.rhcloud.com/?p=61
https://github.com/rhinstaller/libblockdev


2015-05-27 14:31 GMT+02:00 Stef Bon <stefbon@gmail.com>:
> Hi,
>
> I'm working on a program (using sqlite, FUSE and btrfs) to provide
> backup and version managment
> for users. They can enable the backup service for folders they own,
> and select files they want to backup using mimetypes.
>
> This program, which I've called fuse-backup, creates backup subvolumes
> and snapshots by calling an extrenal script, which does something
> like:
>
> btrfs subvolume snapshot -r %PathToBackup%/ %PathToSnapshot%
>
> This works perfect, but are there any plans to do this with a library?
>
> Stef Bon
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Juan Orti
https://miceliux.com

GPG key: https://miceliux.com/pub/pubkey.asc
GPG fingerprint: 61F0 8272 6882 BCA6 3A35  88F6 B630 4B72 DEEB D08B

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-29 19:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27 12:31 Plans for a library for btrfs? Stef Bon
2015-05-27 17:39 ` Duncan
2015-05-29 14:04   ` David Sterba
2015-05-29 14:31 ` Roman Mamedov
2015-05-29 17:02   ` Goffredo Baroncelli
2015-05-29 19:13 ` Juan Orti Alcaine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.