Advertisement
lswest

Example Rsync

Jul 18th, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. #!/bin/bash
  2. LOCALDIR=$HOME/Music/
  3. REMOTEDIR=$HOME/Music/Hyperion/
  4. SERVER=192.168.1.X
  5.  
  6. if [[ `ifconfig|grep "192.168.1.Y"|cut --delimiter=' ' -f 10` == "192.168.1.Y" ]]; then
  7.     notify-send "Syncing with Server..."
  8.     echo "Fetching..."
  9.     rsync --rsh=ssh -aizuKL --log-file=$HOME/music_sync_log $SERVER:$REMOTEDIR $LOCALDIR
  10.     echo "Sending..."
  11.     rsync --rsh=ssh -aizuKL --log-file=$HOME/music_push_log $LOCALDIR $SERVER:$REMOTEDIR
  12.     echo "done."
  13.     notify-send "Complete" "Syncing complete"
  14. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement