I am using git annex to sync a portion of my home directory. The main use/sync point is on my desktop and laptop. The desktop and laptop are connected to a NAS and usb drives.
So, the repos are connected like so:
NAS - backup
^ ^
/ \
desktop - client laptop - client
\ /
v v
USB drive - archive
The idea is the NAS should get all files, the USB drive acts as an archive to keep the clients a bit lighter weight, even while off site.
Question: If the laptop is used offsite with the usb drive archive and the laptop archives a file never yet seen by the NAS, will the NAS ever get this file? Note: the USB drive is never directly connected to the NAS and is not in its list of remotes.
It looks like there is a path the content could go in this case:
You don't mention how you are syncing, but assuming that you're doing so in a way that actually transfers the content to each node of that path (e.g.,
git annex sync --content
with appropriately configured preferred content), then I'd say the answer is "yes".Not sure why I didn't just try this rather than asking... but now that I've tried it, it doesn't make it to the nas.
I would normally be running git annex assistant, but for this test, I ran
on my laptop and then on my desktop without my laptop connected to the network.
When run on my laptop, I had a thumb drive and the external SSD plugged in. The external SSD is an archive. It archived it off the usb thumb drive, because this is a client and left it on my laptop. I plugged in the external ssd to my desktop and ran sync --content, and it never copied it over, because it is archived (as expected) even though the NAS hadn't backed it up yet. I assume this is because the NAS never is directly connected to the usb ssd nor is the ssd ever connected directly to the nas, so the desktop doesn't shuttle it between the two. I suppose I could fix this particular layout by making the nas the archive, but having the ability to have a large data dump when offsite for a long time and have it automatically archive to an ssd seems nice. Perhaps I can make a rule set myself that does what I want, or change the layout with existing groups.
Wow! Such an amazing feature to make your own groups. This is so powerful.
I did this, if anyone else is wanting to do this type setup:
I basically added (not copies=backup:1) to the main client so that it will pull stuff off the archive and deliver it to the NAS before not needing it itself. It did exactly that; in the same sync, it grabbed content from the external ssd, transferred it to the nas, then dropped it.
Sorry, it should have occurred to me that "archive", "client", and "backup" in your initial post were referring to git-annex's standard groups. Indeed then, as you say, the desktop won't get the content from the archive because, as a client, it uses this content expression:
I think that, for the desktop repo, extending the expression above with something like
would do what you're after. That should make the desktop grab the file from the usb if it hasn't reached the NAS.
Here's the complete configuration that I think should be needed:
Oh, I should have refreshed the page. It seems you came up with essentially the same expression :> Sorry for the noise.