git clone [email protected]:abendy/macos-to-s3.git
cd macos-to-s3
python3 -m pip install --user virtualenv
virtualenv venv
. venv/bin/activate
pip3 install -r requirements.txt
mkdir -p /usr/local/var/lib/borg/{cache,security}
mkdir -p keys
sudo ssh-keygen -t ed25519 -C "Borg" -f keys/id_ed25519
sudo chmod 0600 keys/*
sudo chmod 0644 keys/*.pub
cp etc/backup.includes.sample etc/backup.includes
vi etc/backup.includes
cp etc/backup.excludes.sample etc/backup.excludes
vi etc/backup.excludes
cp .env.sample .env
vi .env
You could source this from your shell run commands config
source <path_to>/.env
brew cask install gpg-suite
brew install pass
pass init <gpg_id>
pass generate borg
pass show borg
aws configure
aws iam create-group --group-name <group_name>
aws iam attach-group-policy --group-name <group_name> --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess
aws iam add-user-to-group --group-name <group_name> --user-name <user_name>
aws iam create-access-key --user-name <user_name>
Copy the access key and secret access key and fill out the .env file
mkdir -p <repo_location>
sudo -E borg init --encryption=repokey-blake2 --storage-quota=<size>G <repo_location>
sudo -E ./borg-backup.sh
sudo -E borg list <repo_location>
sudo -E borg list <repo_location>::<archive_name>
sudo -E borg mount <repo_location>::<archive_name> <extract_path>
sudo -E borg extract <repo_location>::<archive_name>
sudo -E borg delete <repo_location>::<archive_name>