Hi,
I try to achieve this with my podcast repository:
I have three repositories all in indirect mode:
- desktop
- backup on usb disk at desktop
- raspberrypi
I want to use the desktop as transfer repository.
If I add a new url on the raspberrypi I want to sync the content via the desktop repository to the backup repository which is no directly accessible from the raspberrypi.
If I add a new url on desktop the content should be moved to raspberrypi and backup.
So I don't want to have the content of the files on the desktop. All content should be in backup.
If content is not in raspberrypi I want to get it from backup via desktop.
What is the best workflow to achieve this?
Currently my problem is that if I do a "git annex sync --content" the content is also copied to desktop. Maybe because the desktop repo is origin?
- backup is in group backup
- desktop is in group transfer
- raspberrypi is in no special group
To do further experiments I need a way to see in what group a repo is, but "git annex show" has no information about this.
TIA
juh
Ok,
here is my current workflow to clarify my problem:
On raspberrypi:
On desktop:
New podcast content from raspberrypi is downloaded.
In backup:
New podcast content from desktop is downloaded.
On desktop:
Everything on desktop is dropped.
Now the problem
Next time I do
on desktop all files are downloaded again from either backup or raspberrypi.
What can I do to have only content in desktop that is not in the raspberrypi repository or in the backup repository?
I thought that this is the behaviour of a transfer repository.
I suspect that if you run
git annex drop --auto
on desktop, it won't drop any files. This is because it's configured as a transfer repository, and transfer repositories wait for files to reach all client repositories before wanting to drop them.Since you have no client repositories, your transfer repository will prefer to hang onto files. In fact, transfer repositories assume there will eventually be at least 2 client repositories (otherwise what good would a transfer repository between clients be?) and so hang onto files that are not in 2 clients, even when less than 2 clients exist yet. That is generally useful behavior when setting things up in eg the webapp.
So, the standard preferred content expression for a transfer repository won't work in this configuration. Let's instead express the things you want as a custom setting.
That assumes you put the raspberrypi in the client group, which is what I think it basically is. Then desktop will want to get and hold any files that have not yet reached all backup and client repositories, at which point desktop will drop files.
It should, in theory, be possible to read preferred content and learn how to write such an expression. Of course, it is a limited form of programming, and so not for everyone. Which is why git-annex ships with standard expressions to cover as many common cases as we can think of.