Last active
August 29, 2015 14:18
-
-
Save suisho/83ec9dc3e8e0a0efeeb3 to your computer and use it in GitHub Desktop.
いい加減macにlsyncdを入れてlinuxに転送しまくりたい。 ref: http://qiita.com/suisho/items/22ad9efcac90127f87a1
This file contains hidden or 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
return { | |
user = "your.name", | |
host = "0.0.0.0", | |
source = "/path/to/source", | |
dest = "/path/to/dest", | |
} |
This file contains hidden or 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
brew update | |
brew install homebrew/dupes/rsync | |
brew install lsyncd lua |
This file contains hidden or 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
sudo lsyncd lsync.conf.lua |
This file contains hidden or 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
-- 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