Skip to content

Instantly share code, notes, and snippets.

@lightszentip
Created December 8, 2016 22:31
#!/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