Backup laptop and Pi
Back to current versionRestore this version

Backup laptop and Pi#

Pi backup (run from MacBook)#

#!/bin/sh
#
#
ssh apollo sudo tar czf - --exclude=/var/jspwiki/logs --exclude=/usr/local/tomcat/logs --exclude=/usr/local/tomcat/work --exclude=/usr/local/tomcat/temp /home/ubuntu /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'
rm /Users/metskem/Downloads/backup-apollo-rest.tar.gpg /Users/metskem/Downloads/backup-apollo-rest.tar

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.

mount /dev/sda1 /mnt/seagate

The actual backup command from MacBook

cd    # start in home dir
tar -czf /tmp/mac-backup.tar .cf .ssh .gnupg .flyrc .zsh_history .zshrc .aws .credhub .oh-my-zsh .git-credentials .gitconfig Pictures .zoomus .bashrc .bash_history Documents workspace Downloads go/src
# encrypt:
echo 'get gpg key from bitwarden' | gpg --passphrase-fd 0 --batch -co /tmp/mac-backup.tar.gpg /tmp/mac-backup.tar
# upload to STACK:
sftp metskem@metskem@metskem.stackstorage.com <<< $'put //tmp/mac-backup.tar.gpg'
rm /tmp/mac-backup.tar.gpg /tmp/mac-backup.tar

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

Unmount external disk:

umount /mnt/seagate