auto_scp.sh 467 B

123456789101112131415161718192021
  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. pwd
  8. CMD='FILE=%f; DEST_FILE=${FILE#*/*/};
  9. scp $FILE superglue:/$DEST_FILE;
  10. if [ $? -eq 0 ]; then
  11. play -q -n synth 0.15 tri 5000.0 gain -25;
  12. else
  13. play -q -n synth 0.5 tri 500.0 gain -10;
  14. fi'
  15. #CMD='echo %f'
  16. iwatch -c "eval $CMD" -e modify -r -X "\.sw.?|\.revision|\.tmp|tools" ./