Skip to content

Instantly share code, notes, and snippets.

@suisho
Last active August 29, 2015 14:18
Show Gist options
  • Save suisho/83ec9dc3e8e0a0efeeb3 to your computer and use it in GitHub Desktop.
Save suisho/83ec9dc3e8e0a0efeeb3 to your computer and use it in GitHub Desktop.
いい加減macにlsyncdを入れてlinuxに転送しまくりたい。 ref: http://qiita.com/suisho/items/22ad9efcac90127f87a1
return {
user = "your.name",
host = "0.0.0.0",
source = "/path/to/source",
dest = "/path/to/dest",
}
brew update
brew install homebrew/dupes/rsync
brew install lsyncd lua
sudo lsyncd lsync.conf.lua
-- variables
local conf = dofile("conf.lua")
local homeDir = os.getenv("HOME")
local target = conf.user.."@".. conf.host..":".. conf.dest
-- lsyncd
settings{
logfile = "/tmp/lsyncd.log",
statusFile = "/tmp/lsyncd.status",
insist = true,
nodaemon = true,
delay = 0,
statusInterval = 10,
maxProcesses = 2,
}
sync{
default.rsync,
delete = false,
source = conf.source,
target = target,
exclude = { ".DS_Store", ".sass-cache/**/*"},
rsync = {
binary = "/usr/local/bin/rsync",
archive = true,
compress = true,
rsh = "/usr/bin/ssh -i "..homeDir.."/.ssh/id_rsa"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment