borg_compact.sh 315 B

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