#!/usr/bin/env bash if [ -d resources/test-data/borg ]; then rm -r resources/test-data/borg resources/borg-data fi mkdir -p resources/test-data/borg || exit mkdir -p resources/borg-data || exit echo "Hello world!" > resources/borg-data/testfile timestamp5=$(date -d "5 days ago" "+%Y-%m-%dT%T") timestamp3=$(date -d "3 days ago" "+%Y-%m-%dT%T") timestamp1=$(date -d "1 day ago" "+%Y-%m-%dT%T") # I asked in #borgbackup about trying to corrupt a repository intentionally # so that we can test the borg check workflow, and it seems like there # isn't really a clear way to reliably do that. borg init --encryption=none ./resources/test-data/borg borg create --timestamp "$timestamp5" resources/test-data/borg::important-older resources/borg-data borg create --timestamp "$timestamp3" resources/test-data/borg::important-newer resources/borg-data borg create --timestamp "$timestamp1" resources/test-data/borg::needless-newer resources/borg-data