Execute shell script on file change? (Folder Actions?)

Jump to First Reply
Posted:
in General Discussion edited January 2014
Hi,



perhaps someone can figure this out. I have a folder with PHP files that I edit with TextMate. After saving them, I want them uploaded to the server; I use rsync to do this. E.g., something like:



Code:


rsync -rvzpP ~/my_folder/someScript.php myServer.com:foo/bar/







Now, it's not a big deal, but it would be sweet if I could have the uploading occur automatically after saving. I could probably hook this into TextMate somehow, or I could use some launchd magic to listen to changes. But perhaps Folder Actions can do this?

Comments

  • Reply 1 of 3
    chuckerchucker Posts: 5,089member
    Hm, so there's no event actually for files having been modified? "on adding folder items" doesn't seem to work in this case. \
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 3
    kickahakickaha Posts: 8,760member
    http://www.macosxhints.com/article.p...60613164904421



    Try that. Modify the plist file as needed, and have it run your rsync.
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 3
    chuckerchucker Posts: 5,089member
    Yeah, I'll give the launchd route a try.
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.