Open stastnypremysl opened 3 years ago
Hi, an experienced noob answering a curious noob.. just me pointing in the right direction to do the required changes to the code yourself.
See the Message print part line in the python code of btrfs-clone ? : if opts.verbose: print ("%s |\n\t %s" % (" ".join(send_cmd), " ".join(recv_cmd))) it's the verbose mode telling you the shell equivalent command format prior to ssh so :
(I'm neglecting the newline and tab which make little sense to me) whereas the common btrfs-receive-over-ssh use case would be :
so adding the missing 'ssh root@10.0.0.2 "' and '"' around recv_cmd could be done in the Execution part of the code, on the line slightly above : recv_cmd = ( [opts.btrfs, "receive"] + VERBOSE + [new] ) perhaps modified so : recv_cmd = ('ssh root@10.0.0.2 " ' + [opts.btrfs, "receive"] + VERBOSE + [new] + '"') where opts.btrfs is the result in make_args() of option -B = --btrfs : set full path to "btrfs" executable and new the target/destination/to path, to assist in recognising the command line "btrfs receive -v /to".
Of course, I'd recommend checking the remote user <root?>, and address
I'm not sure how that affects the recv_cmd status check on line.
I have found only that 1 place to do the modification (in case there were another place for the top level, or other border line exception).
My two cents, as I've not tested it, and my python and shell are rusty, and therefore, the answer to your question seems to be "yes, it seems possible". Thanks for your good question, 2021'er Stastny Premysl.
btrfs-clone
has been written with local cloning in mind. I can see that this might be a useful feature in some situations, but it isn't implemented currently. It's not only about the send/receive operation itself; there are a couple of commands for subvolume creation and moving files around which must be run on the the remote host if ssh is involved. That's a major feature request.
I'm happy to look at patches, but I won't implement this myself.
Is it possible to do btrfs-clone over SSH please?
Thanks. Přemysl