btrsync.sync.root.file¶
Btrfs roots implemented using local file I/O.
Functions
|
Return an appropriate btrfs root class for dumping to a local file. |
|
Return an appropriate btrfs root class sourced from file I/O. |
- btrsync.sync.root.file.DumpRoot(*, sudo=None)[source]¶
Return an appropriate btrfs root class for dumping to a local file.
- btrsync.sync.root.file.FileRoot(*, sudo=None)[source]¶
Return an appropriate btrfs root class sourced from file I/O.
Classes
|
Btrfs root that saves the send stream to a local file in |
|
Read-only btrfs root implemented using local file I/O. |
- class btrsync.sync.root.file.FileRecvRoot(rootpath, *, subroot=None, create_recvpath=False, namer=None, dump_pipe=[], ext='')[source]¶
Btrfs root that saves the send stream to a local file in
receive().Calling
send()will raiseNotImplementedError. Other methods are delegated to subroot, if supplied, or return no-op defaults.- Parameters
rootpath – directory to save the send streams into; if
Nonewill not save any files and dump_pipe must be suppliedsubroot – if supplied, delegate
list()andshow()to this rootcreate_recvpath – if
True, ensure the path passed toreceive()existsnamer – function that takes the send stream metadata and returns a file name, if
Noneuse defaultdump_pipe – a sequence of commands to run in a pipeline and pass the send stream through before saving
ext – extension to append to saved file names
- async classmethod get_root(path, **kwargs)¶
No-op; call constructor with path.
- async classmethod is_root(path)¶
No-op; return
True.
- async list(*args, **kwargs)[source]¶
List available subvolumes within this root, as a sequence of COW hierarchy roots.
- property name¶
Human-readable name identifying this root and the location it refers to.
- async receive(flow, path='.', *, meta={})[source]¶
Perform a receive operation into path using the send stream provided by flow.
- Parameters
flow – a
btrsync.util.Flowcontaining the btrfs send streampath – the relative path to receive into
meta – (optional) additional metadata about the send stream
- Returns
a coroutine that finalizes the receive operation when run
- async send(*args, **kwargs)[source]¶
Not implemented; raises
NotImplementedError.
- async show(*args, **kwargs)[source]¶
Return detailed information about the subvolume pointed to by path.
- static wrapcmds(cmds)¶
Return cmds unchanged; override to customize executed commands.
- class btrsync.sync.root.file.FileSendRoot(rootpath)[source]¶
Read-only btrfs root implemented using local file I/O.
Calling
receive()will raiseNotImplementedError.- Parameters
rootpath – path to the target input file
- async classmethod get_root(path, **kwargs)¶
No-op; call constructor with path.
- async classmethod is_root(path)¶
No-op; return
True.
- property name¶
Human-readable name identifying this root and the location it refers to.
- async receive(flow, path='.', *, meta={})[source]¶
Not implemented; raises
NotImplementedError.
- async send(*paths, parent=None, clones=[])[source]¶
Set up a send operation of paths with parent parent and clones clones.
- Parameters
paths – the paths of the subvolumes to send
parent – if not
None, the path of the parent subvolume to use for incremental sendclones – sequence of paths of clone subvolumes
- Returns
a tuple
(flow, send_coro)containing the sendbtrsync.util.Flowand a coroutine that finalizes the send operation when run