Hi,
how can I handle drop with the assistant? There are some files in my annex that I don't need on my laptop. so i just drop them on the command line bevcause I have copies on my server and an external usb drive. But after a while the assistant pulls all the files back in. Can I avoid this and make the drop somehow "sticky" until i get them over cli?
Best, Michael
Hi,
you can set your repository type to 'manual'.
Best Karsten
The trivial way to do this is to set your repository to "client" and then when you want to drop a file, create a folder called "archive" and drag the file into that folder. The assistant will drop it (if numcopies is satisfied that there are enough copies elsewhere). If you want it back, drag it out of the archive and the assistant will re-fetch it.
This is how I use git-annex: I have an ssh remote and a usb drive which are both "backup" and my laptop is "client", and my numcopies is sent to 2.
Files are always copied to the ssh remote and the usb drive because they're "backup." That fulfills my numcopies=2. At that point, anything in an "archive" folder on my laptop will be dropped automatically.
It means my annex is littered with "archive" folders, but it achieves the desired effect.
As I understand it, nothing will "be the middleman" in the sense of, if annex A has remotes B and C, grabbing content from B in order to give it to C without regards for whether or not A wants it. Annex A doesn't think in terms of moving content from one remote to another remote, only in terms of pulling and pushing to remotes individually.
I get the "move content from remote B to C" effect by setting numcopies=2 and making both remotes "backup." If content is only on remote B, it will migrate to A in order to fulfill numcopies. Then it will migrate to C because of C's preferred content settings.
(Respecting minimum numcopies is higher priority than respecting preferred content settings, so even if A wouldn't normally "want" the content, it will receive it if it needs to in order to fulfill numcopies.)
I've got A set to "client" so content in archive directories disappears once the content is on B and C (because numcopies is fulfilled, and so A's preferred content can take effect.)
If you had A set to "manual," then it wouldn't automatically drop content once it moved from B to A to C, though. Because it would only drop things manually.
@edheil, you used to be right about the middleman. But I'm continually improving things.
So, consider this situation:
If a file is created on A, inside an
archive
directory, B wants a copy, since it's not archived yet. Once B gets the copy, it sends it on the C. At that point, B notices that hey, this file was archived and is in an archive directory, and so it no longer wants its copy and drops it.(At this point A will also want to drop the file. However, it cannot! This is because git-annex requires positive, direct verification that some other repository has a file before dropping it, and A cannot talk to C to check. However, if you set C to be trusted, this verification is bypassed, and then A will be able to drop the file as well.)
This support for middlemen is a new feature, which will be in the next release. You can get it in any recent nightly build.
Amusingly this feature was built without writing any haskell code.. just fine-tuning the preferred content expressions!
We can also consider what happens if B is set to manual. In this case, it won't automatically get the file from A. But if you manually get it, then B will send it on to C. And A will drop the file once it hears that C has it. Due to the manual mode, you'll have to manually drop it from B of course.
Nice! It sounds like there would be another way to accomplish what I'm currently accomplishing by using numcopies=2 and standard client/backup directories. (backup <--> client <--> backup)
In order to get double backups, I could tweak the content settings for my laptop's annex, which is currently set to standard "client" mode, so that it's exactly like "client" mode except that "archive" directories want to drop content which is archived twice. (backup <--> tweaked-client <--> backup)
Then I'd get content automatically copying itself out to two archives, and dropping it when it has done so, without touching numcopies.
No reason not to keep doing it the way I'm doing it, since it's simpler, but it's cool to see the assistant getting smarter.