auto_scp.sh 437 B

12345678910111213141516171819
  1. #!/bin/bash
  2. ## watch files recursively for changes
  3. ## and scp to DEST
  4. ##
  5. ## assumes that DEST host has key based auth enabled,
  6. ## otherwise password will be prompted everytime
  7. CMD='FILE=%f; DEST_FILE=${FILE#*/*/};
  8. scp $FILE superglue:/$DEST_FILE;
  9. if [ $? -eq 0 ]; then
  10. play -q -n synth 0.1 tri 5000.0 gain -15;
  11. else
  12. play -q -n synth 0.5 tri 500.0 gain -10;
  13. fi'
  14. #CMD='echo %f'
  15. iwatch -c "eval $CMD" -e modify -X '\.sw.?' -r .