)]}'
{"playbooks/roles/borg-backup-server/files/prune-borg-backups.sh":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"ce5d7c2291e5d586178dd8d8023da90fb9934ffa","unresolved":true,"context_lines":[{"line_number":57,"context_line":"    do"},{"line_number":58,"context_line":"       echo \"| $(date) - archive ${prefix}\""},{"line_number":59,"context_line":"      /opt/borg/bin/borg prune --prefix ${prefix} ${BORG_OP} --verbose --list --show-rc ${_prune_flags}"},{"line_number":60,"context_line":"      /opt/borg/bin/borg compact ${BORG_REPO}"},{"line_number":61,"context_line":"    done"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    echo \"| $(date) done!\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"b2b1863d_e6577e1d","line":60,"updated":"2026-08-04 15:16:14.000000000","message":"Borg compact was introduced in borg 1.2. Prior to that pruning automatically compacted at the end of its run and there was no separate compact command. This explains the change in behavior we saw.\n\nIt also means that this change will break pruning on the older backup servers. Maybe we need to check the version before compacting or check if the command is present? Otherwise I think this change is great thanks.","commit_id":"e578d554a67628daa5b1eaeb3097104c56bf7578"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"15a35b3aa353ce4d8f8c035aa7e4e43dc37f2675","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    do"},{"line_number":58,"context_line":"       echo \"| $(date) - archive ${prefix}\""},{"line_number":59,"context_line":"      /opt/borg/bin/borg prune --prefix ${prefix} ${BORG_OP} --verbose --list --show-rc ${_prune_flags}"},{"line_number":60,"context_line":"      /opt/borg/bin/borg compact ${BORG_REPO}"},{"line_number":61,"context_line":"    done"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    echo \"| $(date) done!\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"94aba21f_11d6a95c","line":60,"in_reply_to":"5db31188_79ea31b7","updated":"2026-08-12 20:52:59.000000000","message":"Done","commit_id":"e578d554a67628daa5b1eaeb3097104c56bf7578"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"89525080c5ba24bbc907153e3dbb915ba7470fd9","unresolved":true,"context_lines":[{"line_number":57,"context_line":"    do"},{"line_number":58,"context_line":"       echo \"| $(date) - archive ${prefix}\""},{"line_number":59,"context_line":"      /opt/borg/bin/borg prune --prefix ${prefix} ${BORG_OP} --verbose --list --show-rc ${_prune_flags}"},{"line_number":60,"context_line":"      /opt/borg/bin/borg compact ${BORG_REPO}"},{"line_number":61,"context_line":"    done"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    echo \"| $(date) done!\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"5db31188_79ea31b7","line":60,"in_reply_to":"b2b1863d_e6577e1d","updated":"2026-08-12 20:32:48.000000000","message":"Looks like we can run `/opt/borg/bin/borg --help | grep compact` and check the return code to determine if we should compact or not. The compact command is not present in the help text of older borg and is present in newer borg.","commit_id":"e578d554a67628daa5b1eaeb3097104c56bf7578"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"b136e66b781720dcb348771d87904249d0704116","unresolved":true,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# Whether our version has compacting separated from pruning"},{"line_number":25,"context_line":"# TODO(fungi): Clean this up once all servers are on borg 1.2 or later"},{"line_number":26,"context_line":"COMPACT\u003d\"$(/opt/borg/bin/borg --help | grep -q compact)\""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"pushd /opt/backups"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"3e49557e_0c16267c","line":26,"range":{"start_line":26,"start_character":44,"end_line":26,"end_character":46},"updated":"2026-08-12 20:48:08.000000000","message":"Doesn\u0027t the -q mean don\u0027t output anything so COMPACT will always be the empty string? I think we want to check the return code instead. See the comment below.","commit_id":"fedb0b32d7ea01cd58eedb0b3e92621058b3f317"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"15a35b3aa353ce4d8f8c035aa7e4e43dc37f2675","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# Whether our version has compacting separated from pruning"},{"line_number":25,"context_line":"# TODO(fungi): Clean this up once all servers are on borg 1.2 or later"},{"line_number":26,"context_line":"COMPACT\u003d\"$(/opt/borg/bin/borg --help | grep -q compact)\""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"pushd /opt/backups"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"d2964d6e_ad1fca3b","line":26,"range":{"start_line":26,"start_character":44,"end_line":26,"end_character":46},"in_reply_to":"3e49557e_0c16267c","updated":"2026-08-12 20:52:59.000000000","message":"Done","commit_id":"fedb0b32d7ea01cd58eedb0b3e92621058b3f317"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"b136e66b781720dcb348771d87904249d0704116","unresolved":true,"context_lines":[{"line_number":61,"context_line":"    do"},{"line_number":62,"context_line":"       echo \"| $(date) - archive ${prefix}\""},{"line_number":63,"context_line":"      /opt/borg/bin/borg prune --prefix ${prefix} ${BORG_OP} --verbose --list --show-rc ${_prune_flags}"},{"line_number":64,"context_line":"      if [ \"$COMPACT\" ]; then"},{"line_number":65,"context_line":"        /opt/borg/bin/borg compact ${BORG_REPO}"},{"line_number":66,"context_line":"      fi"},{"line_number":67,"context_line":"    done"}],"source_content_type":"text/x-sh","patch_set":2,"id":"0931667c_3b10d0bb","line":64,"updated":"2026-08-12 20:48:08.000000000","message":"I think this would work instead:\n\n```\nif /opt/borg/bin/borg --help | grep -q compact ; then\n  # compact\nfi\n```","commit_id":"fedb0b32d7ea01cd58eedb0b3e92621058b3f317"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"15a35b3aa353ce4d8f8c035aa7e4e43dc37f2675","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    do"},{"line_number":62,"context_line":"       echo \"| $(date) - archive ${prefix}\""},{"line_number":63,"context_line":"      /opt/borg/bin/borg prune --prefix ${prefix} ${BORG_OP} --verbose --list --show-rc ${_prune_flags}"},{"line_number":64,"context_line":"      if [ \"$COMPACT\" ]; then"},{"line_number":65,"context_line":"        /opt/borg/bin/borg compact ${BORG_REPO}"},{"line_number":66,"context_line":"      fi"},{"line_number":67,"context_line":"    done"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3feed320_619271fd","line":64,"in_reply_to":"0931667c_3b10d0bb","updated":"2026-08-12 20:52:59.000000000","message":"Approach differs but addresses the -q problem a different way.","commit_id":"fedb0b32d7ea01cd58eedb0b3e92621058b3f317"}]}
