-
-
Save kalupa/733094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/* [email protected]:/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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment