News for hackers. Stuff that matters.
Re:Show HN: Pullbox – A dead-simple dropbox alternative usin... by jamiesonbecker on Friday August 14, 2015 @10:09PM (#10064051)
Forking might be easier to debug.. but I think I might have missed some of the functionality in your script.. something like (totally untested):

   (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."
    wait
Re:Show HN: Pullbox – A dead-simple dropbox alternative usin... by prashanthellina on Friday August 14, 2015 @10:28PM (#10064089)
That is Gold! Implementing the functionality in shell itself was what I considered first however I needed two things

1. 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".

[0]: https://facebook.github.io/watchman/docs/install.html

Re:Show HN: Pullbox – A dead-simple dropbox alternative usin... by jamiesonbecker on Friday August 14, 2015 @10:47PM (#10064125)
Yeah that should work!