forum/what rules is git annex sync --content using to send files outgit-annexhttp://git-annex.branchable.com/forum/what_rules_is_git_annex_sync_--content_using_to_send_files_out/git-annexikiwiki2018-05-04T16:00:58Znumcopieshttp://git-annex.branchable.com/forum/what_rules_is_git_annex_sync_--content_using_to_send_files_out/comment_1_86428fc8286266d01cc51af8ae4aa335/andrew2018-03-27T22:25:30Z2018-03-27T22:25:30Z
<p>||| <em>When I add a new file to my client clone and do git annex sync --content is this respecting the … content of each remote or is it only trying to satisfy the numcopy?</em></p>
<p>Both.</p>
<p>Running <code>git annex sync --content</code> will copy content to any remote where that content is wanted (IE look at the preferred content settings), and will drop files that are not wanted and don't violate numcopies totals (at the moment of the drop?).</p>
<p>||| <em>One of the remotes is set as archive and two as smallarchive yet sync --content only ever copies to one so as to satisfy numcopies.</em></p>
<p>I don't believe that <code>git annex sync --content</code> is ever trying to “satisfy numcopies,” I would think of numcopies as more of a limit or restriction on when git-annex is allowed to drop content that is not wanted by a remote.</p>
<p>||| <em>Shouldn't it always try to make two copies in archive or smallarchive?</em></p>
<p>Hmmmm. I would guess there is some issue with your archive or smallarchive expressions, or they aren't actually set (being used) or you have discovered an issue… You have overridden the standard groups, and can see your overrides with <code>git annex groupwanted archive</code> and <code>git annex groupwanted smallarchive</code>? And your remotes have <code>git annex group archive</code> and <code>git annex wanted groupwanted</code> set?</p>
<p>So <code>(include=*/archive/* or include=archive/*) and</code> means you are only copying files in the archive directory, was that your intention?</p>
<p>If so, the rest of your content expression seems like it should want 1 copy in an archive and 1 copy in a smallarchive, or 2 copies in 2 remotes marked archive or 2 copies in two remotes marked smallarchive.</p>
<p>||| <em>Interestingly, it copies data to my backup</em></p>
<p>Right. If you are using a standard content group backup means “All content is wanted. Even content of old/deleted files.” This expression will want all content and never drop content.</p>
comment 2http://git-annex.branchable.com/forum/what_rules_is_git_annex_sync_--content_using_to_send_files_out/comment_2_50c1a19a7278e8748c2e6e789f6b418a/MatusGoljer2018-03-28T23:16:51Z2018-03-28T23:16:51Z
<p>Hi Andrew!</p>
<p>Actually, you are entirely correct, I just misinterpreted the <code>smallarchive</code> formula. What I was thinking it would do was it would upload the file in case there are not two copies in any combination of <code>archive</code> or <code>smallarchive</code> and as soon as there are two <code>archive</code> copies it would ideally drop the file if not in <code>*/archive/*</code> directory.</p>
<p>But now I see that the formula does exactly what you say it would do, the whole long <code>and not</code> condition is additional to the first, which means a file will not get uploaded if not in those directories.</p>
<p>I will play around with the expression, I'm sure it can be modified to do what I want.</p>
<p>Thanks! It was mostly me being silly, sometimes having other people re-state the obvious helps!</p>
comment 3http://git-annex.branchable.com/forum/what_rules_is_git_annex_sync_--content_using_to_send_files_out/comment_3_368403625451415c66b9e62005d9ddea/joey2018-04-04T16:17:53Z2018-04-04T16:14:45Z
<p>I just wanted to say thanks to andrew for a really excellent response here.
I've answered plenty of such questions less well.
I hope you answer many more questions about git-annex with such care and
attention to detail.</p>
<p>And, thanks to MatusGoljer for following up to confirm that you were
misunderstanding -- and I agree that you should be able to adjust the
preferred content expression to do what you want it to do.</p>
comment 4http://git-annex.branchable.com/forum/what_rules_is_git_annex_sync_--content_using_to_send_files_out/comment_4_53ccb5c7c8f15f44fb2f113742fe77f3/andrew2018-05-04T16:00:58Z2018-05-04T16:00:58Z
<p>Thanks Joey! I am glad to hopefully take some work off your plate.</p>
<p>—Andrew</p>