by jamiesonbecker · 11y ago · 0 comments
(while true
do
inotifywait \
--exclude '.*\.sw.' \
--recursive \
--event close_write \
--event delete \
--event moved_to \
--event moved_from \
dir1/
git push
sleep 0.1
done
) 2>&1 >/var/log/push_log.log &
(while true
do
cat << 'EOF' | ssh remotebox
inotifywait \
--exclude '.*\.sw.' \
--recursive \
--event close_write \
--event delete \
--event moved_to \
--event moved_from \
dir1/
git push #??
sleep 0.1
EOF # (second EOF cannot be indented)
done
) 2>&1 >/var/log/pull_log.log &
echo "Kicked off pull and push processes."
wait1. Make it work on OSX 2. Use a lock file to prevent multiple instances from running when I put this in crontab
I found watchman[0]. Got to see if I can use that in place of "inotifywait".