Backup laptop and Pi#

Pi backup (run from MacBook)#

#!/bin/sh
#
#
ssh pi@apollo sudo tar cf - /appl/piwigo/config/www/gallery/galleries > /Users/metskem/Downloads/backup-apollo-fotos.tar
ssh pi@apollo sudo tar czf - --exclude=/var/jspwiki/logs --exclude=/usr/local/tomcat/logs --exclude=/usr/local/tomcat/work --exclude=/usr/local/tomcat/temp /home/pi /etc /var/jspwiki /usr/local > /Users/metskem/Downloads/backup-apollo-rest.tar
# encrypt:
echo 'get gpg key from bitwarden' | gpg --passphrase-fd 0 --batch -co /Users/metskem/Downloads/backup-apollo-rest.tar.gpg /Users/metskem/Downloads/backup-apollo-rest.tar
# upload to STACK:
sftp metskem@metskem@metskem.stackstorage.com <<< $'put /Users/metskem/Downloads/backup-apollo-rest.tar.gpg'

Laptop backup#

This is a backup from my MacBook to the external disk attached to my Pi.
Make sure the external disk is plugged and mounted.
If you just plugged it in:

mount /dev/sda1 /mnt/seagate

If it was already plugged in, but powered off:

# power on USB device:
echo -n "0000:00:10.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
echo -n "0000:00:10.0" > /sys/bus/pci/drivers/xhci_hcd/bind

The actual backup command from MacBook

rsync -a .cf .ssh .gnupg .flyrc .zsh_history .zshrc .aws .credhub .oh-my-zsh .git-credentials .gitconfig Pictures .zoomus .bashrc .bash_history Documents workspace Downloads go  apollo:/mnt/seagate/harry/athena

Checkout the actual contents of transip stack here: https://metskem.stackstorage.com/files

Power off the external disk:

udisksctl unmount -b /dev/sda1 && udisksctl power-off -b /dev/sda1