dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

todosync (434B)


      1 #!/bin/sh
      2 
      3 LOCAL_TODO="$HOME/.todo"
      4 REMOTE_TODO="storage/documents/markor/todo.txt"
      5 REMOTE_HOST="artoo"
      6 DAEMON_RESTART="SVDIR=/data/data/com.termux/files/usr/var/service sv restart todod"
      7 
      8 exec inotifywait -e close_write -m $LOCAL_TODO|while read TODOFILE; do 
      9 	echo rsyncing
     10 	rsync -e "ssh -i $HOME/.ssh/todod" $LOCAL_TODO $REMOTE_HOST:$REMOTE_TODO
     11 	ssh -i $HOME/.ssh/todod $REMOTE_HOST "${DAEMON_RESTART}"
     12 	echo finished rsync
     13 done