comment
authorJoey Hess <joeyh@joeyh.name>
Wed, 16 Mar 2022 19:18:24 +0000 (15:18 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 16 Mar 2022 19:18:24 +0000 (15:18 -0400)
doc/forum/Remove_unused_content_from_S3_special_remote/comment_1_acfd4eab2cd80d722479dbb410ccfe2e._comment [new file with mode: 0644]

diff --git a/doc/forum/Remove_unused_content_from_S3_special_remote/comment_1_acfd4eab2cd80d722479dbb410ccfe2e._comment b/doc/forum/Remove_unused_content_from_S3_special_remote/comment_1_acfd4eab2cd80d722479dbb410ccfe2e._comment
new file mode 100644 (file)
index 0000000..8b6d882
--- /dev/null
@@ -0,0 +1,26 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2022-03-16T19:08:41Z"
+ content="""
+There is not a way to do that using only git-annex.
+
+If the new S3 remote is encrypted and the old one was unencrypted,
+you can easily tell which files in the bucket are encrypted and not based
+on their names and delete those. The encrypted files have names starting
+with "GPGHMAC"
+
+If the new S3 remote is not encrypted, you can generate a list of all
+the keys that are expected to be in it like this:
+
+       git-annex whereis --all --in dir --format='${hashdirlower}${key}\n' | sort > wanted
+
+If you then use some S3 tool to generate a list of all the files in the
+bucket, and put that list in a file named "all", you can then use
+`comm` to find the files that are in "all" that are not in "wanted":
+
+       sort all > all-sorted
+       comm -1 -3 wanted all-sorted
+
+Then you can use some S3 tool to delete the other files.
+"""]]