Skip to content

Instantly share code, notes, and snippets.

@lightszentip
Created December 8, 2016 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lightszentip/9558283d339c4cb19d5b691fae0e060a to your computer and use it in GitHub Desktop.
Save lightszentip/9558283d339c4cb19d5b691fae0e060a to your computer and use it in GitHub Desktop.
#!/bin/bash
#
##### Backup Script for my local Filesystem
##### run only if I have connection with my secure home wlan
# Get the wlan essid
essid=$(iwgetid -r)
echo $essid;
# check the name, exit otherwise
if [ "$essid" = "nameofmywlan" ]
then
echo "True, we are connected to the right wlan"
# TODO Check if nas server is exist
rsync -aPuvb --modify-window=1 --exclude ".@__thumb" --delete --backup-dir '../dirforbackup' --stats --password-file=filewithpasswordandpath /pathtodir/ rsyncusername@serverip::sharedfolder/pathtomydironnas
else
echo "Wrong WLAN"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment