Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- require 'osx/foundation'
- OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework'
- include OSX
- $d=File.basename Dir.pwd
- Dir.chdir '..'
- fsevents_cb = proc do |stream, ctx, numEvents, paths, marks, eventIDs|
- system "rsync -vcir ~/projects/karrupa/neuchatel/site/sites/all/* controllercode.com@controllercode.com:/nfs/c06/h01/mnt/88354/domains/neuchatel.karrupa.com/html/sites/all/"
- # system "rsync --delete -rt --rsh=ssh . methylblue.com:public_html/#{$d}"
- end
- stream = FSEventStreamCreate(
- KCFAllocatorDefault,
- fsevents_cb,
- nil,
- [$d],
- KFSEventStreamEventIdSinceNow,
- 1.0,
- 0)
- die "Failed to create the FSEventStream" unless stream
- FSEventStreamScheduleWithRunLoop(
- stream,
- CFRunLoopGetCurrent(),
- KCFRunLoopDefaultMode)
- die "Failed to start the FSEventStream" unless FSEventStreamStart(stream)
- CFRunLoopRun()
Add Comment
Please, Sign In to add comment