forum/Desktop as transfer repositorygit-annexhttp://git-annex.branchable.com/forum/Desktop_as_transfer_repository/git-annexikiwiki2015-12-02T17:32:19ZMy current workflowhttp://git-annex.branchable.com/forum/Desktop_as_transfer_repository/comment_1_b211b8f0ab58b8e59ce31d6ed6cb3c8c/juh2015-11-17T14:47:59Z2015-11-17T14:47:59Z
<p>Ok,</p>
<p>here is my current workflow to clarify my problem:</p>
<p>On raspberrypi:</p>
<pre><code>Adding new podcasts
git annex sync
</code></pre>
<p>On desktop:</p>
<pre><code>git annex sync
git annex get --want-get
</code></pre>
<p>New podcast content from raspberrypi is downloaded.</p>
<p>In backup:</p>
<pre><code>git annex sync
git annex get --want-get
</code></pre>
<p>New podcast content from desktop is downloaded.</p>
<p>On desktop:</p>
<pre><code>git annex drop
</code></pre>
<p>Everything on desktop is dropped.</p>
<p><strong>Now the problem</strong></p>
<p>Next time I do</p>
<pre><code>git annex get --want-get
</code></pre>
<p>on <strong>desktop</strong> all files are downloaded again from either backup or raspberrypi.</p>
<p>What can I do to have only content in desktop that is not in the raspberrypi repository or in the backup repository?</p>
<p>I thought that this is the behaviour of a transfer repository.</p>
comment 2http://git-annex.branchable.com/forum/Desktop_as_transfer_repository/comment_2_9a943bcfe7679e469acc6fa1f78324b7/joey2015-11-18T17:52:12Z2015-11-18T17:15:34Z
<p>I suspect that if you run <code>git annex drop --auto</code> 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.</p>
<p>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.</p>
<p>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.</p>
<blockquote><p>If I add a new url on desktop the content should be moved to raspberrypi and backup.</p>
<p>So I don't want to have the content of the files on the desktop. All
content should be in backup.</p>
<p>If content is not in raspberrypi I want to get it from backup via desktop.</p></blockquote>
<pre><code>git annex wanted desktop "not (inallgroup=backup and inallgroup=client)"
</code></pre>
<p>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.</p>
Thankshttp://git-annex.branchable.com/forum/Desktop_as_transfer_repository/comment_3_17165386df0c8c0085de29659f46f084/juh2015-11-19T08:01:09Z2015-11-19T08:01:09Z
This line seems to do the trick. The flexibility of git annex is amazing – and frightening. I fear I would have never found the line by myself.
comment 4http://git-annex.branchable.com/forum/Desktop_as_transfer_repository/comment_4_986e7d7bb536685f48731ffbbab4dc7c/joey2015-12-02T17:32:19Z2015-12-02T17:29:25Z
<p>It should, in theory, be possible to read <a href="http://git-annex.branchable.com/forum/preferred_content/">preferred content</a> 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.</p>