Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable send/receive#6

Open
Vaelatern wants to merge 1 commit into
JavaScriptDude:main from
Vaelatern:add-send-recv
Open

Enable send/receive #6
Vaelatern wants to merge 1 commit into
JavaScriptDude:main from
Vaelatern:add-send-recv

Conversation

@Vaelatern

@Vaelatern Vaelatern commented Apr 7, 2024
edited
Loading

Copy link
Copy Markdown

This worked for me.

On the receiving side I had to:

sudo zfs allow $(whoami) receive,create,mount tank

On the sending side I had to

sudo zfs allow -u $(whoami) send,hold tank

then this worked from an un-elevated user:

local_dataset.receive(remote_newest_snapshot.send(remote_common_snapshot))

where the two snapshots were from a zfslib.Connection() to one server and the dataset was a zfslib.Connection to another.

When there were errors, I saw them and the program I was running exited. Had I chosen to trap more exceptions in my own code, I would have been able to decide not to exit.

Copy link
Copy Markdown
Owner

Thanks for the PR. Although zfslib was written to be read oriented, I'll give it a read through and figure out if this make sense to put in or whether a modify centric library that uses zfslib would be a better fit.

Copy link
Copy Markdown
Author

I had the choice to make, either do the send within python (where I identified the correct snapshots to move), or print the shell commands and then execute them.

Printing shell commands then lost the setup I'd done for ssh sessions, so after doing it manually once, I decided to embed it in python to keep all that context right there.

I did note that none of the fields in zfslib are even possibly destructive. Unlike this, which in theory could be (if additional features are added to these commands).

Copy link
Copy Markdown
Author

Of course this mechanism could also exist as something duck-punched in (I found the term in one of the comments in the code, and loved it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /