Add --print-uri option to "tahoe backup" to dump resulting backup URI #2135
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#2135
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When I do scripted backups to my grid, I would like to collect the resulting backup root URI to a file. I've added a "--printcap" option to "tahoe backup" to do it and works good, so far.
Off by default for backwards compatibility. Comes to mind someone using "tahoe backup" from a script piping the output to a file and mailing it. Other than this, looks like an trivial addition.
Code is at:
https://github.com/tahoe-lafs/tahoe-lafs/pull/76
Also you can accomplish David Sarah's case at /tahoe-lafs/trac-2024-07-25/issues/5897#10 with this one-liner:
The mkdir'ed directory URI is completely ignored, we will just keep the --printcap'ed URI as the immutable backup root.
+1
It might be good to add this option to the docs in
frontends/CLI.rst
.Also a doubt:
Better to print the URI alone with no surrounding text (as it's done in "tahoe put" or "tahoe mkdir")?
If there was a --quiet option it would make sense, but printed along the backup summary, I think it's not worth it.
Replying to amontero:
Yes, that's a problem for use in scripts. Maybe print the URI alone on
stdout
, and the backup summary onstderr
when--printcap
is used?Great idea, +1. Also, it's low hanging fruit :)
Done it, stripped the "Resulting backup..." string. Sample console output below.
It's OK to also redirect the more verbose messages to stderr?
I mean this one:
Yes.
As discussed in IRC:
Updated the pull request accordingly for review.
Also, I proposed Daira to make --print-uri the default behavior to make it consistent with "tahoe put" and "tahoe mkdir". However, this could be a security issue for existing scripts. Needs further discussion.
Add --printcap option to "tahoe backup" to dump resulting backup URIto Add --print-uri option to "tahoe backup" to dump resulting backup URII'll review this patch/pull request.
Great code so far. I feel this would be quite useful for scripting backups.
There is still 2 failing backup related tests from this patch/pull request. The cli--tahoe-backup--dump-backup-dircap-stdout--tests branch from https://github.com/pataquets/tahoe-lafs/ seems to have some attempt at fixing those failing tests but they are still present.
There should also be an additional test in allmydata.test.test_cli.Backup to test this new command option.
Reassigning back to amontero for patch changes.
This could potentially get into 1.11 if the tests were fixed, but the core developers will be focussing on other things, so that depends on amontero.