Guest User

Untitled

a guest
Jul 16th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #!/usr/bin/ruby
  2. require 'osx/foundation'
  3. OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework'
  4. include OSX
  5.  
  6. $d=File.basename Dir.pwd
  7. Dir.chdir '..'
  8.  
  9. fsevents_cb = proc do |stream, ctx, numEvents, paths, marks, eventIDs|
  10. 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/"
  11. # system "rsync --delete -rt --rsh=ssh . methylblue.com:public_html/#{$d}"
  12. end
  13.  
  14. stream = FSEventStreamCreate(
  15. KCFAllocatorDefault,
  16. fsevents_cb,
  17. nil,
  18. [$d],
  19. KFSEventStreamEventIdSinceNow,
  20. 1.0,
  21. 0)
  22.  
  23. die "Failed to create the FSEventStream" unless stream
  24.  
  25. FSEventStreamScheduleWithRunLoop(
  26. stream,
  27. CFRunLoopGetCurrent(),
  28. KCFRunLoopDefaultMode)
  29.  
  30. die "Failed to start the FSEventStream" unless FSEventStreamStart(stream)
  31.  
  32. CFRunLoopRun()
Add Comment
Please, Sign In to add comment