#!/bin/bash # Load environment variables from .env file source .env # Export Borg passphrase export BORG_PASSPHRASE=$PASSPHRASE export BORG_RSH="ssh -i $SSH_KEY -p $SSH_PORT" sudo -E borg compact --verbose "$SERVER_USER@$SERVER_IP:$REPOSITORY" if [ $? -ne 0 ]; then echo "Borg compact failed." exit 1 fi