Skip to content

Instantly share code, notes, and snippets.

@electronut
Created July 6, 2013 02:52
Show Gist options
  • Save electronut/5938436 to your computer and use it in GitHub Desktop.
Save electronut/5938436 to your computer and use it in GitHub Desktop.
backup script for Raspberry Pi - tested on OS X
# backup script for Raspberry Pi
#
# electronut.in
#
#!/bin/bash
echo Backing up RPi \#1...
# set this to Raspberry Pi IP address
PI_ADDR="192.168.4.31"
# set this to Raspberry Pi code directory
# note that the trailing / is important with rsync
PI_DIR="code/"
# set this to local code (backup) directory
BKUP_DIR="/Users/mahesh/code/rpi1/"
# run rsync
# use this first to test:
# rsync -uvrn pi@$PI_ADDR:$PI_DIR $BKUP_DIR
rsync -uvr pi@$PI_ADDR:$PI_DIR $BKUP_DIR
echo ...
echo done.
# play sound - optional
afplay /System/Library/Sounds/Basso.aiff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment